sed裏面變量單引號

sed -i '/HostDomain/s/'${DB1_DOMAIN}'/'${new_domain}'/g' $c_pub_config

裏面的單引號不用轉義 而且變量是可用的。。

cat plssh_config.sh

updateTime="2012-12-20"
relServerN="relServer_1.0.1.1_20121225_1"
relServerM="a25079a4b8fc5f5db06e85c1ef8109f9"
newcdnName="frmmo_S6_new12"

sed -i 's#relServerM=.*#relServerM="'${rel_md5}'"#g'  plssh_config.sh

裏面的變量用‘’括起來

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章