SED search / replace

I need to use sed to search for the string /' and replace it with '''' I tried this but it did not work

sed -e 's/(/')/('''')/g'

but it did not work.
jmelcherAsked:
Who is Participating?
 
ozoCommented:
sed -e "s#/'#''''#g"
0
 
jmelcherAuthor Commented:
sed - e expression #3, char 10: untermindated `s' command

using this syntax:
"s#/'#''''g"
0
 
ozoCommented:
You are missing the final #
0
Cloud Class® Course: Ruby Fundamentals

This course will introduce you to Ruby, as well as teach you about classes, methods, variables, data structures, loops, enumerable methods, and finishing touches.

 
jmelcherAuthor Commented:
wait it didnt replace every occurance of \' in the file. I think it just replaced the first one.
0
 
jmelcherAuthor Commented:
Nope it isn't working. It isn't replacing the /' in the file with ''''
0
 
ozoCommented:
Did you include the g?
0
 
ozoCommented:
did you say /' or \'
0
 
jmelcherAuthor Commented:
yeah. I tried this as well and it did not work:
sed -e "s#/'#''''#g"
and this
sed -e "s#'#''''#g"

neither worked.
0
 
jmelcherAuthor Commented:
forward slash (/)
0
 
jmelcherAuthor Commented:
so in plain english replace forward slash single quote with 4 single quotes.
0
 
jmelcherAuthor Commented:
wait I'm not paying attention: replace backslash (\) single quote with 4 single quotes
0
 
ozoCommented:
sed -e "s#\\\\'#''''#g"
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.