If you want to substitute strings via sed, it is very easy:
Any other ideas? What abaout using the dollar (money always helps ;-):
# echo 'hello world!' |sed 's/hello/it is a cool/'But what if you want to use a strong quote inside the substitution?
it is a cool world!
# echo 'hello world!' |sed 's/hello/it's a cool/'gets interpreted from the shell and nothing happens. Next try: Escape the strong quote with a backslash:
# echo 'hello world!' |sed 's/hello/it\'s a cool/'Does not work...
Any other ideas? What abaout using the dollar (money always helps ;-):
# echo 'hello world!' |sed $'s/hello/it\'s a cool/'
it's a cool world!