更新时间:2022-04-28 04:54:54
将 sed -e 命令组合起来创建单个 sed 脚本.以下产生相同的结果(注意 -e 是隐含的):
The sed -e commands are combined to create a single sed script. The following yields the same results (notice that -e is implied):
sed '
s/1/ONE/
s/2/TWO/
/3/q
s/ONE/THREE/
' input.txt
或者作为单衬:
sed 's/1/ONE/; s/2/TWO/; /3/q; s/ONE/THREE/' input.txt