Results 1 to 3 of 3
I have a js string bounded by single quotes ('') . That requires that I escape the single quote (') that occurs in "I'm" or "don't". I want " I'm ...
- 08-18-2010 #1Just Joined!
- Join Date
- Aug 2010
- Location
- Rochester, NY USA
- Posts
- 9
how to replace ' with \' in sed ?
I have a js string bounded by single quotes ('') . That requires that I escape the single quote (') that occurs in "I'm" or "don't". I want "I'm" to become "I\'m".
Fair enough. But this doesn't work: sed -e "s/\'/\'/g"
The replacement string is unescapable I believe and must be a literal.
How do I do this in sed ?
- 08-18-2010 #2
- 08-18-2010 #3Just Joined!
- Join Date
- Aug 2010
- Location
- Rochester, NY USA
- Posts
- 9
Works !
Your solution works perfectly! Thank you so much! This had befuddled me for half an hour.
(-Regards, Verlager)


Reply With Quote