Right now I'm using
echo sed '/\Random/a \
newly added line' info.txt
to append some text to a file but I also need to add text below a certain string let's say random, I know it is possible with sed, But when the script runs, it shows the new file content in the console, but it is not actually showing the same changes in the file.
example:-
Input File
Some text
Random
Some stuff
Output File
Some text
Random
newly added line
Some stuff
info.txt
file with thesed
command, look in the man page for the-i
option. – Sotto Voce Sep 25 '22 at 12:24