sed command issue

Hi everybody,

I have come across a typical problem:

I need to use sed command to replace an apostrophe but it is saying no match found in the error

sed -e 's/`/'/g' ...but it is not working. Can you please tell me how to use this apostrophe in this sed command please. Thanks.

Rubin

sed -e "s/\`/'/g" 

should work..

no scrutinizer it is not working

# echo \`max\` | sed "s/\`/'/g"
'max'

:wink:

Strange... and this:

sed 's/`/'"'/g"

---------- Post updated at 05:55 PM ---------- Previous update was at 05:50 PM ----------

Possibly your character is not a backtick but an opening single quote. If that is the case you'd have to replace my ` character with your own...

do it with awk

$ echo \`max\`  | awk '{gsub("`","\047")}1'
'max'

Sorry I found that the symbol I wanna replace is \xb4 character ..its a front tick and not a back tick.. ..not sure how to write it in script and I have to replace it with single tick apostrophe...I just cannot do this with the same error message ..no match found...any clue guys...sorry for being restless..but he main problem is apostrophe replacement

I see. Try:

 sed "s/�/'/g"

or if that does not work:

sed "s/$(echo -e '\xb4')/'/g"

Thanks scrutinizer, and all ,,,It is working now...Thanks again