This question already has an answer here:
I'm trying to edit a file on a remote server via a terminal and to make a change in said file I have to (or have used so far) use the 'sed' command.
in the below file i want to delete the string
STUFF_456 and its new line character.
STUFF_123 STUFF_456 STUFF_789
However when I use this command in
sed i'm left with a blank line.
$ sed -i 's/STUFF_456//' /file/path/here.txt STUFF_123 STUFF_789
I need to get rid of the blank line and keep the other two entries.
How can I accomplish this?