脚本专栏 
首页 > 脚本专栏 > 浏览文章

awk区间取值的例子

(编辑:jimmy 日期: 2025/4/20 浏览:3 次 )
有如下的文本内容:
*********
123123
123123
*********
321321
321321
*********
456456
456456
*********
123123
123123
********

匹配123,取出******区间的内容:
awk -vRS="*+" '/123/{print RT$0}' file

说明:
RS The input record separator, by default a newline(\n).
RT The record terminator. Gawk sets RT to the input text that matched the character or regular expression specified by RS.
上一篇:查看某时间段到现在的系统日志的sed命令
下一篇:except自动登录的几段代码分享
一句话新闻
Windows上运行安卓你用过了吗
在去年的5月23日,借助Intel Bridge Technology以及Intel Celadon两项技术的驱动,Intel为PC用户带来了Android On Windows(AOW)平台,并携手国内软件公司腾讯共同推出了腾讯应用宝电脑版,将Windows与安卓两大生态进行了融合,PC的使用体验随即被带入到了一个全新的阶段。
友情链接:杰晶网络 DDR爱好者之家 南强小屋 黑松山资源网 白云城资源网 网站地图 SiteMap