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