带有特殊字符的 sed 字符串 New
sed string with special character New
当我使用此脚本替换时:
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'
谁能帮帮我
提前致谢
敬上,
优素福
使用\
转义/
:
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
当我使用此脚本替换时:
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'
谁能帮帮我 提前致谢
敬上, 优素福
使用\
转义/
:
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