I am looking for a way to replace a string in a file with a string that contains a slash by using sed.
connect="192.168.100.61/foo"
srcText="foo.bar=XPLACEHOLDERX"
echo $srcText | sed "s/XPLACEHOLDERX/$connect"
The result is:
sed: -e Expression #1, Character 32: Unknown option for `s'
sed
andawk
(and perl). – G-Man Says 'Reinstate Monica' Apr 21 '22 at 00:59