我有以下文件:
#!example
#!toto
example
#example
;example
toto
example除了以"#!"开头的行之外,我想删除包含字符串"example"的行。
因此,结果文件应该是:
#!example
#!toto
toto如何仅使用sed命令来完成此操作?
发布于 2013-04-20 00:25:53
如果只想保留以#!开头的行
$ sed '/#!/!d' foo.sh
#!example
#!totohttps://stackoverflow.com/questions/16109207
复制相似问题