I need to substitute some text inside a text file with a replacement. Usually I would do something like
sed -i 's/text/replacement/g' path/to/the/file
The problem is that both
replacement are complex strings containing dashes, slashes, blackslashes, quotes and so on. If I escape all necessary characters inside
text the thing becomes quickly unreadable. On the other hand I do not need the power of regular expressions: I just need to substitute the text literally.
Is there a way to do text substitution without using regular expressions with some bash command?
It would be rather trivial to write a script that does this, but I figure there should exist something already.