sed的一些tricks

1.sed -f xx.sed input_file

可以将一系列操作放在一个xx.sed脚本里执行

```

#!/bin/sed -f

```

2.在匹配字符串后面或行尾添加内容

在text后面添加content: sed 's/text/& content/g' input_file

在行尾添加content: sed's/$/content/g' input_file

原文地址:https://www.cnblogs.com/domainfei/p/4021669.html