awk区间取值的例子
awk区间取值的例子
发布时间:2016-12-28 来源:查字典编辑
摘要:有如下的文本内容:*********123123123123*********321321321321*********4564564564...

有如下的文本内容:

*********

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.

推荐文章
猜你喜欢
附近的人在看
推荐阅读
拓展阅读
相关阅读
网友关注
最新linuxshell学习
热门linuxshell学习
脚本专栏子分类