sed -i "/xxxxxxxxxxxx/r inc-sausage" git.html
sed -i "/xxxxxxxxxxxx/d" git.html
First I insert the content of inc-sausage when xxxxxxxxxxxx is found
Second I delete xxxxxxxxxxxx
Both commands do exactly what I want. But how can I combine both sed commands to a single one?
I tried
sed -i "s/xxxxxxxxxxxx/r inc-sauasge" git.html
For starters, you coould concatenate both
sedcommands into one line and avoid repeating the search string, like this:Also, if you want to delete
xxxxxxxxxxxxonly and not other things in its line, you could do that instead: