qua*_*gar 2 text-processing regular-expression
假设我想删除以下文件中的第 2 行和第 3 行,而不是第 4 行(那些匹配 foo 但不匹配 bar 的行),我可以用例如 sed 轻松地做到这一点吗?
text foo some more text even more foo text some foo text with bar
qua*_*gar 5
这似乎对我有用:
sed '/foo/{/bar/!d;}' my_file
归档时间:
10 年,10 月 前
查看次数:
265 次
最近记录: