bash – egrep匹配组不打印?

我正在尝试创建一个bash脚本,它将使用egrep从文件中grep行.我创建了应该将我想要的信息分组的正则表达式,问题是尝试获取输出.我一直用以下命令测试它,但运行时没有打印.如何在 – {80}和断开连接之间打印多行?
egrep -E "^-{80}$\r?\n?([:ascii:]*)Disconnected from Server" testing.txt

文件:testing.txt

Connected to the server: name here

Some header text.
More text to go though...
--------------------------------------------------------------------------------
The information that I want,would be in here;

Including this line as well #$
and this one.

Disconnected from Server...
你可能最好使用像awk这样的工具.
awk '/^----+$/ {flag=1;next} /Disconnected from Server/{flag=0} flag {print}'

见:http://nixtip.wordpress.com/2010/10/12/print-lines-between-two-patterns-the-awk-way/

相关文章

用的openwrt路由器,家里宽带申请了动态公网ip,为了方便把2...
#!/bin/bashcommand1&command2&wait从Shell脚本并行...
1.先查出MAMP下面集成的PHP版本cd/Applications/MAMP/bin/ph...
1、先输入locale-a,查看一下现在已安装的语言2、若不存在如...
BashPerlTclsyntaxdiff1.进制数表示Languagebinaryoctalhexa...
正常安装了k8s后,使用kubect工具后接的命令不能直接tab补全...