sed to remove single and double quotes at the same time

后端 未结 7 2273
忘了有多久
忘了有多久 2020-12-28 20:38

I am trying to remove single quotes and double quotes from a file. Can I do it in a single sed command?

I am trying :

sed \'s/\\\"//g;s/\\\'//g\' tx         


        
7条回答
  •  孤独总比滥情好
    2020-12-28 21:27

    You cannot escape a single quote inside a pair of singe quotes in shell. Escaping double quotes is allowed though. Following sed command should work:

    sed "s/['\"]//g" file
    

提交回复
热议问题