当前位置: 移动技术网 > 网络运营>服务器>Linux > awk区间取值的例子

awk区间取值的例子

2017年12月12日  | 移动技术网网络运营  | 我要评论
有如下的文本内容:
*********
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.

如对本文有疑问, 点击进行留言回复!!

相关文章:

验证码:
移动技术网