0

It' s easy to find and replace text in sed using

sed 's/text/replace_text/g'

But how to use this if we have ' in text or replace_text? I want to replace { by '{ for an awk script.

I tried different ways:

  • sed 's/{/'{/g' 22 > 23

    results in Unmatched '.

  • sed 's/{/"'"{/g' 22 > 23

    result in Unmatched ".

Can anyone tell how to do it?

0 Answers0