sed string with special character New

41 views Asked by At

when i use this script to replace :

mrm.fr.mycompany.com by 10.70.89.40:8081/artifactory


sed -i -e "s/mrm.fr.mycompany.com/10.70.89.40:8081/artifactory/g" config.xml

i have the error :

 sed: -e expression n°1, caractère 41: option inconnue pour `s'

can anyone help me thanks in advance

regard, Youssef

1

There are 1 answers

0
Cyrus On BEST ANSWER

Escape / with \:

sed -i 's/mrm.fr.mycompany.com/10.70.89.40:8081\/artifactory/' config.xml

Or use this:

sed -i 's|mrm.fr.mycompany.com|10.70.89.40:8081/artifactory|' config.xml