I am trying to achieve the following with bash:
Create a file called "file" which contains the following data:
line1
line2
line3456
I want to append additional characters after "line2", for example:
line1
line2 test123
line3456
I know that I can use sed
to replace the whole line (sed -i 's/line2/line2 test123/' file
). But I am sure that there is a better way to do it.
I intend to modify lines with more than one word in a line so maybe I will need wildcards as well.