Skip to content

Instantly share code, notes, and snippets.

@johnbender johnbender/foo.sh
Last active Dec 13, 2015

Embed
What would you like to do?
Replace a sed match with file contents.
replace=foo
replace_with=bar.txt
replace_in=baz.txt
sed -i.bkp "/$replace/{
s/$replace//g
r $replace_with
}" $replace_in
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.