[root@7 test]# cat 7.txt
7
(
7
7
q
7
7
q
7
7
q
7
)
7
7
7
7
7
7
7
[root@7 test]# awk '/\(/,/\)/ { if (/7/) i++ } END { print i }' 7.txt
7
Linux从入门到放弃 awk if判断
最新推荐文章于 2023-11-18 09:00:00 发布
[root@7 test]# cat 7.txt
7
(
7
7
q
7
7
q
7
7
q
7
)
7
7
7
7
7
7
7
[root@7 test]# awk '/\(/,/\)/ { if (/7/) i++ } END { print i }' 7.txt
7

被折叠的 条评论
为什么被折叠?