【发布时间】:2016-09-07 19:26:40
【问题描述】:
这是我的文件内容,它是 pflogsumm 的输出
Host/Domain Summary: Messages Received
---------------------------------------
msg cnt bytes host/domain
-------- ------- -----------
415 5416k abc.com
13 19072 xyz.localdomain
Senders by message count
------------------------
415 alert@example.com
13 root@jelly.localdomain
Recipients by message count
---------------------------
506 alert@apple.com <= Extract from here to ...
70 info@pafpro.org.us
..
...
19 gems@gmail.com
17 info@aol.com
13 hemdem@gmail.com <= Extract ends here
Senders by message size
-----------------------
5416k alert@google.com
...
...
输出似乎包含由“标题”和“新行”分隔的信息字段。例如Recipients by message count ...<contents of interest> ... NewLine
我尝试使用下面的 sed 表达式,但它在匹配字符串 "Recipients by message count"
sed -nr '/.*Recipients by message count/,/\n/ p'
所需输出:"Recipients by message count" 下的所有电子邮件
【问题讨论】:
-
不清楚,想要的输出是什么!!!请准确。
-
为了清楚起见更新了帖子