相关疑难解决方法(0)

模式匹配时如何将文本添加到行尾?

输入:

line1 with the PATTERN that contains ( ) 
line2 with the PATTERN that contains ( ) 
lineN with the PATTERN that contains ( ) 
Run Code Online (Sandbox Code Playgroud)

输出:

line1 with the PATTERN that contains ( ) ;
line2 with the PATTERN that contains ( ) ;
...
lineN with the PATTERN that contains ( ) ;
Run Code Online (Sandbox Code Playgroud)

我试过这个:

find . -name "test.txt" -print | xargs sed -i "/PATTERN/ s/$)/); /g"
Run Code Online (Sandbox Code Playgroud)

但它没有用。

shell sed line-editor

8
推荐指数
1
解决办法
2万
查看次数

标签 统计

line-editor ×1

sed ×1

shell ×1