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:
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:
Which us probably the same error.
Any help is always appreciated.
I get this error
Quote:
sed: -e expression #1, char 11: unknown option to `s' |
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' |
Any help is always appreciated.