Operating System - HP-UX
1854708 Members
18747 Online
104102 Solutions
New Discussion

Re: single quote escape - sed

 
SOLVED
Go to solution
Declan Heerey
Frequent Advisor

single quote escape - sed

I want to replace double quotes in a file with single, the sed command i am using is:

sed 's/"/'/g

but it just removes the double quotes, it doesn't replace them - any ideas?

Thanks

Declan
4 REPLIES 4
Rodney Hills
Honored Contributor
Solution

Re: single quote escape - sed

Try-

sed "s/\"/'/g"

HTH

-- Rod Hills
There be dragons...
Declan Heerey
Frequent Advisor

Re: single quote escape - sed

Blinding - thanks!!!
Dustin Black
Advisor

Re: single quote escape - sed

You may need to escape the slingle quote as well:

sed s/\"/\'/g
Declan Heerey
Frequent Advisor

Re: single quote escape - sed

The single quote did not need to be escaped but cheers

thanks for the speedy replies guys