文件看起来像这样:
[section1] a=something [section_name2] a=something [section3] a=something
我该如何a=someother仅替换为section_name2?
a=someother
section_name2
使用地址范围:
sed '/\[section_name2\]/,/^\[/ s/a=something/a=someother/'
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
点击生成二维码
我来说两句