o bash funciona bem para isso:
$ cat replace
foo/bar\baz
the second line
$ cat file
the replacement string goes >>here<<
$ repl=$(<replace)
$ str="here"
$ while IFS= read -r line; do
echo "${line//$str/$repl}"
done < file
the replacement string goes >>foo/bar\baz
the second line<<
O awk funcionaria, exceto que ele interpretará escapes de barra invertida (o \b
no meu exemplo)
$ awk -v string="here" -v replacement="$(<replace)" '
{gsub(string, replacement); print}
' file
the replacement string goes >>foo/baaz
the second line<<