I'm trying to use sed
to make several substitutions and insertions of an input string.
However, I recently noticed that the insert command i
doesn't terminate on ;
like others, and instead prints the rest of the string.
$ sed "s/^foo/bar/; 1i foo foo foo; s/foo$/baz/;"
When running that command on the following input,
foo bar baz
I get the following incorrect output.
foo foo foo; s/foo$/baz/;
bar bar baz
What's the correct way to terminate that command?