What is the best solution to appending new text after an existing block of text in a text file, using a BASH script?
for example, I have a config file with the following:
[setting1]
...
[setting2]
...
[setting3]
I want to add some text after [setting2]
, e.g.:
test1=data
test2=data
test3=data
Therefore, I want it to look like this after the script is run:
[setting1]
...
[setting2]
test1=data
test2=data
test3=data
...
[setting3]