自己尝试和查询了很久奈何 sed 不是很熟用的太少,而且服务器环境固定不能使用其它发布语言,现在就是想用 sed 修改<soap:address location “ https:192.168.105.34 ” /> 冒号中间的值,如何写假定替换值是环境变量$url,多谢
|
araralorenOct 10, 2018
1
冒号??????
|
|
2
@araraloren “”写错抱歉
|
|
3
抱歉是“”中间的值
|
|
blankmeOct 10, 2018
4
sed 用 double quotes 会自动扩展环境变量
export url="127.0.0.1"; sed -i "s/\".*\"/\"$url\"/g" yourfile |
|
ableOct 10, 2018
7
sed "s/\".*\"/\"$url\"/g"
|