Abhay_maniyar Abhay_maniyar - 3 months ago 10
Linux Question

How can I replace some characters with `'` character in a text file using sed?

this is the command I know

sed -i 's/&#39/'/g' output.txt
. As I figured out that the second
'
character is the cause of unexpected result here. Please tell me how to replace characters with a
'
in a text file. Thanks in advance.

Answer
sed -i 's/&#39/\'/g' output.txt

This will do the task. You need additional \

Comments