Execute a cat command within a sed command in Linux
Given original.txt
with content:
this is some text that needs replacement
and replacement.txt
with content:
no changes
I'm not sure what your replacement criteria is, but lets say I want to replace all occurrences of the word replacement
in the original file, you may replace the content of the original text with the content of the other file using:
> sed -e 's/replacement/'"`cat replacement.txt`"'/g' original.txtthis is some text that needs no changes