【发布时间】:2012-07-01 00:37:06
【问题描述】:
使用 sed,如果文件中的一行上有空格字符,我需要打印带有空格字符的输出以及删除后的任何内容。代码示例:
sed "s/"something here I think"//g' file
所以,假设一个文件在一行上说:
Chuck Norris is the man
我只需要它打印:
Chuck
多行也适用:
Chuck Norris is the man
So is Arnold
替换:
Chuck
So
【问题讨论】: