I want a Bash script that puts userinput
into a file called software.txt
. But I need the userinput
to be under a specific line #addedsoftware
in software.txt
. The script should be able to add useriput
multiple times into this file. Is this something that can be achieved with something like sed
?
When i ran sed '/#TESTING/a some text here' software.txt
it did not add it to the file. Then i ran sed '/#TESTING/a some text here' > software.txt
This one just adds whatever keys i press after the command is ran.
Edit i got it working with.: sed -i '/#TESTING/a some text here' file