File looks like this:
[section1]
a=something
[section_name2]
a=something
[section3]
a=something
How do I replace a=someother
only in section_name2
?
Use an address range:
sed '/\[section_name2\]/,/^\[/ s/a=something/a=someother/'
この記事はインターネットから収集されたものであり、転載の際にはソースを示してください。
侵害の場合は、連絡してください[email protected]
コメントを追加