?
Solved

SED search / replace

Posted on 2009-04-30
12
Medium Priority
?
383 Views
Last Modified: 2012-05-06
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.
0
Comment
Question by:jmelcher
  • 7
  • 5
12 Comments
 
LVL 85

Accepted Solution

by:
ozo earned 2000 total points
ID: 24272581
sed -e "s#/'#''''#g"
0
 

Author Comment

by:jmelcher
ID: 24272675
sed - e expression #3, char 10: untermindated `s' command

using this syntax:
"s#/'#''''g"
0
 
LVL 85

Expert Comment

by:ozo
ID: 24272710
You are missing the final #
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 

Author Comment

by:jmelcher
ID: 24272746
wait it didnt replace every occurance of \' in the file. I think it just replaced the first one.
0
 

Author Comment

by:jmelcher
ID: 24272839
Nope it isn't working. It isn't replacing the /' in the file with ''''
0
 
LVL 85

Expert Comment

by:ozo
ID: 24272854
Did you include the g?
0
 
LVL 85

Expert Comment

by:ozo
ID: 24272863
did you say /' or \'
0
 

Author Comment

by:jmelcher
ID: 24272872
yeah. I tried this as well and it did not work:
sed -e "s#/'#''''#g"
and this
sed -e "s#'#''''#g"

neither worked.
0
 

Author Comment

by:jmelcher
ID: 24272874
forward slash (/)
0
 

Author Comment

by:jmelcher
ID: 24272881
so in plain english replace forward slash single quote with 4 single quotes.
0
 

Author Comment

by:jmelcher
ID: 24272900
wait I'm not paying attention: replace backslash (\) single quote with 4 single quotes
0
 
LVL 85

Expert Comment

by:ozo
ID: 24272946
sed -e "s#\\\\'#''''#g"
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The purpose of this article is to fix the unknown display problem in Linux Mint operating system. After installing the OS if you see Display monitor is not recognized then we can install "MESA" utilities to fix this problem or we can install additio…
The purpose of this article is to demonstrate how we can upgrade Python from version 2.7.6 to Python 2.7.10 on the Linux Mint operating system. I am using an Oracle Virtual Box where I have installed Linux Mint operating system version 17.2. Once yo…
This Micro Tutorial will teach you how to add a cinematic look to any film or video out there. There are very few simple steps that you will follow to do so. This will be demonstrated using Adobe Premiere Pro CS6.
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…
Suggested Courses

850 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question