2015-06-15 143 views
0

sed的字符串时,我使用这个脚本来代替:特殊字符新

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 

我有错误:

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

谁能帮助我 在此先感谢

方面, Youssef

回答

0

Escape /\

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

或者使用:

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

非常感谢赛勒斯 – Yalami