Article 5P2J9 sed command with /

sed command with /

by
gilesaj001
from LinuxQuestions.org on (#5P2J9)
I am trying to use the sed command like this Code: sed -i 's/cd /usr/bin/prp/prpclient-1/#cd /usr/bin/prp/prpclient-1/g' /home/dingo/myscript.sh" to change cd /usr/bin/prp/prpclient-1 to #cd /usr/bin/prp/prpclient-1

I get this error

Quote:
sed: -e expression #1, char 11: unknown option to `s'
I am not sure if it is the # or the / that is the problem. I am not a programmer and at 71 can't think as well as I used to.

I also want to use the command with pssh to change the file in multiple machines Code: parallel-ssh -h hosts_file.txt -i "sed -i 's/cd /usr/bin/prp/prpclient-1/#cd /usr/bin/prp/prpclient-1/g' /home/dingo/myscript.sh" but I also get an error.
Quote:
Exited with error code 1
Stderr: sed: -e expression #1, char 11: unknown option to `s'
Which us probably the same error.

Any help is always appreciated.latest?d=yIl2AUoC8zA latest?i=8Q2iDattDQs:8uJSLnrWQEk:F7zBnMy latest?i=8Q2iDattDQs:8uJSLnrWQEk:V_sGLiP latest?d=qj6IDK7rITs latest?i=8Q2iDattDQs:8uJSLnrWQEk:gIN9vFw8Q2iDattDQs
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments