【发布时间】:2010-06-29 08:47:35
【问题描述】:
我正在处理一些旧代码,我发现我曾经使用过
sed -E 's/findText/replaceWith/g' #findText would contain a regex
但我现在试试
sed -e 's/findText/replaceWith/g'
它似乎做同样的事情,或者是吗? 我有点记得我这样做是有原因的,但我不记得了,做“man sed”并没有帮助,因为他们没有关于 -E only -e 的任何东西,这对以太没有多大意义。
-e, --expression=script
Append the editing commands in script to the end of
the editing command script. script may contain more
than one newline separated command.
我认为 -e 意味着它会与正则表达式匹配...
GNU sed version 4.2.1
【问题讨论】: