I want to replace %foo%
(found in file test) with a string containing every possible character. Because of the missing character limitation, the following is not possible (executed in BASHv4):
echo %foo% > test
replacement="//this//is//a//test"
ed -s test <<< "g/%foo%/s/%foo%/$replacement"
Any idea how to replace %foo%
with every possible text?
With command
r
it is possible to load text from another file, so the following is a valid solution:r FILE