Skip to content

Commit

Permalink
Site updated: 2023-12-10 11:10:54
Browse files Browse the repository at this point in the history
  • Loading branch information
thr committed Dec 10, 2023
1 parent 7b6d083 commit 9d48b6e
Show file tree
Hide file tree
Showing 27 changed files with 133 additions and 133 deletions.
2 changes: 1 addition & 1 deletion 2023/11/18/Awk/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -375,4 +375,4 @@ <h3 id="6-3-代码实现"><a href="#6-3-代码实现" class="headerlink" title="



</article><div class="post-copyright"><div class="post-copyright__author"><span class="post-copyright-meta"><i class="fas fa-circle-user fa-fw"></i>文章作者: </span><span class="post-copyright-info"><a href="https://tangsmallrong.github.io">thr</a></span></div><div class="post-copyright__type"><span class="post-copyright-meta"><i class="fas fa-square-arrow-up-right fa-fw"></i>文章链接: </span><span class="post-copyright-info"><a href="https://tangsmallrong.github.io/2023/11/18/Awk/">https://tangsmallrong.github.io/2023/11/18/Awk/</a></span></div><div class="post-copyright__notice"><span class="post-copyright-meta"><i class="fas fa-circle-exclamation fa-fw"></i>版权声明: </span><span class="post-copyright-info">本博客所有文章除特别声明外,均采用 <a href="https://creativecommons.org/licenses/by-nc-sa/4.0/" target="_blank">CC BY-NC-SA 4.0</a> 许可协议。转载请注明来自 <a href="https://tangsmallrong.github.io" target="_blank">thr's blog</a></span></div></div><div class="tag_share"><div class="post-meta__tag-list"><a class="post-meta__tags" href="/tags/awk/">awk</a></div><div class="post_share"></div></div><nav class="pagination-post" id="pagination"><div class="prev-post pull-left"><a href="/2023/11/18/Fabric%E5%85%A5%E9%97%A8/" title="Fabric 入门"><div class="cover" style="background: var(--default-bg-color)"></div><div class="pagination-info"><div class="label">上一篇</div><div class="prev_info">Fabric 入门</div></div></a></div><div class="next-post pull-right"><a href="/2023/11/18/Jmeter/" title="Jmeter 压测"><div class="cover" style="background: var(--default-bg-color)"></div><div class="pagination-info"><div class="label">下一篇</div><div class="next_info">Jmeter 压测</div></div></a></div></nav></div><div class="aside-content" id="aside-content"><div class="sticky_layout"><div class="card-widget" id="card-toc"><div class="item-headline"><i class="fas fa-stream"></i><span>目录</span><span class="toc-percentage"></span></div><div class="toc-content"><ol class="toc"><li class="toc-item toc-level-1"><a class="toc-link" href="#%E4%BD%BF%E7%94%A8-awk-%E7%BC%96%E5%86%99-shell-%E8%84%9A%E6%9C%AC"><span class="toc-text">使用 awk 编写 shell 脚本</span></a><ol class="toc-child"><li class="toc-item toc-level-2"><a class="toc-link" href="#1-awk-%E5%9F%BA%E7%A1%80"><span class="toc-text">1. awk 基础</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#2-%E6%96%87%E6%9C%AC%E6%A0%BC%E5%BC%8F%E5%8C%96"><span class="toc-text">2. 文本格式化</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#2-1-awk-%E5%86%85%E7%BD%AE%E5%8F%98%E9%87%8F"><span class="toc-text">2.1 awk 内置变量</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#2-2-%E8%87%AA%E5%8A%A8%E5%AE%9A%E4%B9%89%E8%BE%93%E5%87%BA%E5%86%85%E5%AE%B9"><span class="toc-text">2.2 自动定义输出内容</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#2-3-awk-%E5%8F%82%E6%95%B0"><span class="toc-text">2.3 awk 参数</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#2-4-%E6%98%BE%E7%A4%BA%E6%96%87%E4%BB%B6%E7%AC%AC5%E8%A1%8C"><span class="toc-text">2.4 显示文件第5行</span></a></li></ol></li><li class="toc-item toc-level-2"><a class="toc-link" href="#3-awk-%E6%A8%A1%E5%BC%8F-pattern"><span class="toc-text">3. awk 模式 pattern</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#4-awk-%E4%B8%8E%E6%AD%A3%E5%88%99%E8%A1%A8%E8%BE%BE%E5%BC%8F"><span class="toc-text">4. awk 与正则表达式</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#5-awk-%E6%A1%88%E4%BE%8B"><span class="toc-text">5. awk 案例</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#5-1-%E6%8F%92%E5%85%A5%E6%96%B0%E5%AD%97%E6%AE%B5%E5%92%8C%E6%A0%BC%E5%BC%8F%E5%8C%96%E7%A9%BA%E7%99%BD"><span class="toc-text">5.1 插入新字段和格式化空白</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#5-2-%E7%AD%9B%E9%80%89-IPV4-%E5%9C%B0%E5%9D%80"><span class="toc-text">5.2 筛选 IPV4 地址</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#5-3-%E8%AF%BB%E5%8F%96-ini-%E9%85%8D%E7%BD%AE%E6%96%87%E4%BB%B6%E4%B8%AD%E7%9A%84%E6%9F%90%E6%AE%B5"><span class="toc-text">5.3 读取 .ini 配置文件中的某段</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#5-4-%E6%A0%B9%E6%8D%AE%E6%9F%90%E5%AD%97%E6%AE%B5%E5%8E%BB%E9%87%8D"><span class="toc-text">5.4 根据某字段去重</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#5-5-%E6%AC%A1%E6%95%B0%E7%BB%9F%E8%AE%A1"><span class="toc-text">5.5 次数统计</span></a></li></ol></li><li class="toc-item toc-level-2"><a class="toc-link" href="#6-%E8%AF%BE%E5%90%8E%E4%BD%9C%E4%B8%9A"><span class="toc-text">6. 课后作业</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#6-1-%E9%9C%80%E6%B1%82"><span class="toc-text">6.1 需求</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#6-2-%E5%AE%9E%E7%8E%B0%E6%80%9D%E8%B7%AF"><span class="toc-text">6.2 实现思路</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#6-3-%E4%BB%A3%E7%A0%81%E5%AE%9E%E7%8E%B0"><span class="toc-text">6.3 代码实现</span></a></li></ol></li></ol></li></ol></div></div></div></div></main><footer id="footer"><div id="footer-wrap"><div class="copyright">&copy;2020 - 2023 By thr</div></div></footer></div><div id="rightside"><div id="rightside-config-hide"><button id="readmode" type="button" title="阅读模式"><i class="fas fa-book-open"></i></button><button id="darkmode" type="button" title="浅色和深色模式转换"><i class="fas fa-adjust"></i></button><button id="hide-aside-btn" type="button" title="单栏和双栏切换"><i class="fas fa-arrows-alt-h"></i></button></div><div id="rightside-config-show"><button id="rightside-config" type="button" title="设置"><i class="fas fa-cog fa-spin"></i></button><button class="close" id="mobile-toc-button" type="button" title="目录"><i class="fas fa-list-ul"></i></button><button id="go-up" type="button" title="回到顶部"><span class="scroll-percent"></span><i class="fas fa-arrow-up"></i></button></div></div><div><script src="/js/utils.js"></script><script src="/js/main.js"></script><script src="https://cdn.jsdelivr.net/npm/@fancyapps/ui/dist/fancybox/fancybox.umd.min.js"></script><div class="js-pjax"></div><script async data-pjax src="//busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script><div id="local-search"><div class="search-dialog"><nav class="search-nav"><span class="search-dialog-title">搜索</span><span id="loading-status"></span><button class="search-close-button"><i class="fas fa-times"></i></button></nav><div class="is-center" id="loading-database"><i class="fas fa-spinner fa-pulse"></i><span> 数据库加载中</span></div><div class="search-wrap"><div id="local-search-input"><div class="local-search-box"><input class="local-search-box--input" placeholder="搜索文章" type="text"/></div></div><hr/><div id="local-search-results"></div><div id="local-search-stats-wrap"></div></div></div><div id="search-mask"></div><script src="/js/search/local-search.js"></script></div></div></body></html>
</article><div class="post-copyright"><div class="post-copyright__author"><span class="post-copyright-meta"><i class="fas fa-circle-user fa-fw"></i>文章作者: </span><span class="post-copyright-info"><a href="https://tangsmallrong.github.io">thr</a></span></div><div class="post-copyright__type"><span class="post-copyright-meta"><i class="fas fa-square-arrow-up-right fa-fw"></i>文章链接: </span><span class="post-copyright-info"><a href="https://tangsmallrong.github.io/2023/11/18/Awk/">https://tangsmallrong.github.io/2023/11/18/Awk/</a></span></div><div class="post-copyright__notice"><span class="post-copyright-meta"><i class="fas fa-circle-exclamation fa-fw"></i>版权声明: </span><span class="post-copyright-info">本博客所有文章除特别声明外,均采用 <a href="https://creativecommons.org/licenses/by-nc-sa/4.0/" target="_blank">CC BY-NC-SA 4.0</a> 许可协议。转载请注明来自 <a href="https://tangsmallrong.github.io" target="_blank">thr's blog</a></span></div></div><div class="tag_share"><div class="post-meta__tag-list"><a class="post-meta__tags" href="/tags/awk/">awk</a></div><div class="post_share"></div></div><nav class="pagination-post" id="pagination"><div class="next-post pull-full"><a href="/2023/11/18/Jmeter/" title="Jmeter 压测"><div class="cover" style="background: var(--default-bg-color)"></div><div class="pagination-info"><div class="label">下一篇</div><div class="next_info">Jmeter 压测</div></div></a></div></nav></div><div class="aside-content" id="aside-content"><div class="sticky_layout"><div class="card-widget" id="card-toc"><div class="item-headline"><i class="fas fa-stream"></i><span>目录</span><span class="toc-percentage"></span></div><div class="toc-content"><ol class="toc"><li class="toc-item toc-level-1"><a class="toc-link" href="#%E4%BD%BF%E7%94%A8-awk-%E7%BC%96%E5%86%99-shell-%E8%84%9A%E6%9C%AC"><span class="toc-text">使用 awk 编写 shell 脚本</span></a><ol class="toc-child"><li class="toc-item toc-level-2"><a class="toc-link" href="#1-awk-%E5%9F%BA%E7%A1%80"><span class="toc-text">1. awk 基础</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#2-%E6%96%87%E6%9C%AC%E6%A0%BC%E5%BC%8F%E5%8C%96"><span class="toc-text">2. 文本格式化</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#2-1-awk-%E5%86%85%E7%BD%AE%E5%8F%98%E9%87%8F"><span class="toc-text">2.1 awk 内置变量</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#2-2-%E8%87%AA%E5%8A%A8%E5%AE%9A%E4%B9%89%E8%BE%93%E5%87%BA%E5%86%85%E5%AE%B9"><span class="toc-text">2.2 自动定义输出内容</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#2-3-awk-%E5%8F%82%E6%95%B0"><span class="toc-text">2.3 awk 参数</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#2-4-%E6%98%BE%E7%A4%BA%E6%96%87%E4%BB%B6%E7%AC%AC5%E8%A1%8C"><span class="toc-text">2.4 显示文件第5行</span></a></li></ol></li><li class="toc-item toc-level-2"><a class="toc-link" href="#3-awk-%E6%A8%A1%E5%BC%8F-pattern"><span class="toc-text">3. awk 模式 pattern</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#4-awk-%E4%B8%8E%E6%AD%A3%E5%88%99%E8%A1%A8%E8%BE%BE%E5%BC%8F"><span class="toc-text">4. awk 与正则表达式</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#5-awk-%E6%A1%88%E4%BE%8B"><span class="toc-text">5. awk 案例</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#5-1-%E6%8F%92%E5%85%A5%E6%96%B0%E5%AD%97%E6%AE%B5%E5%92%8C%E6%A0%BC%E5%BC%8F%E5%8C%96%E7%A9%BA%E7%99%BD"><span class="toc-text">5.1 插入新字段和格式化空白</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#5-2-%E7%AD%9B%E9%80%89-IPV4-%E5%9C%B0%E5%9D%80"><span class="toc-text">5.2 筛选 IPV4 地址</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#5-3-%E8%AF%BB%E5%8F%96-ini-%E9%85%8D%E7%BD%AE%E6%96%87%E4%BB%B6%E4%B8%AD%E7%9A%84%E6%9F%90%E6%AE%B5"><span class="toc-text">5.3 读取 .ini 配置文件中的某段</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#5-4-%E6%A0%B9%E6%8D%AE%E6%9F%90%E5%AD%97%E6%AE%B5%E5%8E%BB%E9%87%8D"><span class="toc-text">5.4 根据某字段去重</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#5-5-%E6%AC%A1%E6%95%B0%E7%BB%9F%E8%AE%A1"><span class="toc-text">5.5 次数统计</span></a></li></ol></li><li class="toc-item toc-level-2"><a class="toc-link" href="#6-%E8%AF%BE%E5%90%8E%E4%BD%9C%E4%B8%9A"><span class="toc-text">6. 课后作业</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#6-1-%E9%9C%80%E6%B1%82"><span class="toc-text">6.1 需求</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#6-2-%E5%AE%9E%E7%8E%B0%E6%80%9D%E8%B7%AF"><span class="toc-text">6.2 实现思路</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#6-3-%E4%BB%A3%E7%A0%81%E5%AE%9E%E7%8E%B0"><span class="toc-text">6.3 代码实现</span></a></li></ol></li></ol></li></ol></div></div></div></div></main><footer id="footer"><div id="footer-wrap"><div class="copyright">&copy;2020 - 2023 By thr</div></div></footer></div><div id="rightside"><div id="rightside-config-hide"><button id="readmode" type="button" title="阅读模式"><i class="fas fa-book-open"></i></button><button id="darkmode" type="button" title="浅色和深色模式转换"><i class="fas fa-adjust"></i></button><button id="hide-aside-btn" type="button" title="单栏和双栏切换"><i class="fas fa-arrows-alt-h"></i></button></div><div id="rightside-config-show"><button id="rightside-config" type="button" title="设置"><i class="fas fa-cog fa-spin"></i></button><button class="close" id="mobile-toc-button" type="button" title="目录"><i class="fas fa-list-ul"></i></button><button id="go-up" type="button" title="回到顶部"><span class="scroll-percent"></span><i class="fas fa-arrow-up"></i></button></div></div><div><script src="/js/utils.js"></script><script src="/js/main.js"></script><script src="https://cdn.jsdelivr.net/npm/@fancyapps/ui/dist/fancybox/fancybox.umd.min.js"></script><div class="js-pjax"></div><script async data-pjax src="//busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script><div id="local-search"><div class="search-dialog"><nav class="search-nav"><span class="search-dialog-title">搜索</span><span id="loading-status"></span><button class="search-close-button"><i class="fas fa-times"></i></button></nav><div class="is-center" id="loading-database"><i class="fas fa-spinner fa-pulse"></i><span> 数据库加载中</span></div><div class="search-wrap"><div id="local-search-input"><div class="local-search-box"><input class="local-search-box--input" placeholder="搜索文章" type="text"/></div></div><hr/><div id="local-search-results"></div><div id="local-search-stats-wrap"></div></div></div><div id="search-mask"></div><script src="/js/search/local-search.js"></script></div></div></body></html>
Loading

0 comments on commit 9d48b6e

Please sign in to comment.