分页: 1 / 1

sed的工作原理

发表于 : 2010-08-16 17:06
earthchild
源文档:quote.txt
the first line
the second line
the third line
the fourth line

sed '2p' quote.txt 输出
the first line
the second line
the second line
the third line
the fourth line

sed -n '2p' quote.txt 输出
the second line

谁能根据这个例子说说sed的工作原理?

Re: sed的工作原理

发表于 : 2010-08-16 17:29
trigger
awk和sed很强大,也很复杂,三两句说不清。《abs guide》慢慢看,我看的很费劲 :em03

Re: sed的工作原理

发表于 : 2010-08-16 18:36
aerofox
不带 -n 参数时,sed 自动输出模式空间(没做处理时就是输入的内容)。