- 论坛徽章:
- 1
|
- [root@everIover ~]# awk '/result count/||/name is/{print $0;n=0}/business/{n++}{if(n>2)print gensub(/.*\[(.*)\].*/,"\\1","g",$0)}' i
- result count:11
- name isiaozhang(1),xiaowang(1),喜欢shell(1)
- help001 go
- result count:22
- name isiaozhang(2),xiaowang(2),喜欢shell(2)
- help002 go
- result count:33
- name isiaozhang(3),xiaowang(3),喜欢shell(3)
- help003 go
- [root@everIover ~]# cat i
- result count:11
- name isiaozhang(1),xiaowang(1),喜欢shell(1)
- 无关的字符串多行
- shell*****
- 无关的字符串多行
- business fwfwfw***
- business fwfwfofwfw***
- business 898 __23-[help001 go]_211
- result count:22
- name isiaozhang(2),xiaowang(2),喜欢shell(2)
- 无关的字符串多行
- shell*****
- 无关的字符串多行
- business fwfwfw***
- business fwfwfofwfw***
- business 898 __23-[help002 go]_211
- result count:33
- name isiaozhang(3),xiaowang(3),喜欢shell(3)
- 无关的字符串多行
- shell*****
- 无关的字符串多行
- business fwfwfw***
- business fwfwfofwfw***
- business 898 __23-[help003 go]_211
- [root@everIover ~]#
复制代码 顺便说一句,楼主再发帖子的时候 可以选择 禁用表情,或者用代码块发,你这样看着太别扭了 |
|