replacing double quotes with backslash and double quotes- shell script

  Kiến thức lập trình

I am trying to replace a double quotes (“) with back slash and double quotes (“) however it’s not working

echo '"hello workd"' | tr '"' '\""'

This gives me

hello workd

and following does nothing.

echo '"hello workd"' | tr '"' '"'  

LEAVE A COMMENT