#!/bin/bash ## ## ## FILEPATH=/etc/hosts SVNAME=a.abc.com NEWIP=1.1.1.1 sed -i ‘s/^.*‘$SVNAME‘.*$/‘$NEWIP‘ ‘$SVNAME‘/‘ $FILEPATH ## 行内包含“SVNAME”参数,则将整行替换
原文地址:https://www.cnblogs.com/itbox/p/12687228.html
时间: 2024-10-01 20:14:08
#!/bin/bash ## ## ## FILEPATH=/etc/hosts SVNAME=a.abc.com NEWIP=1.1.1.1 sed -i ‘s/^.*‘$SVNAME‘.*$/‘$NEWIP‘ ‘$SVNAME‘/‘ $FILEPATH ## 行内包含“SVNAME”参数,则将整行替换
原文地址:https://www.cnblogs.com/itbox/p/12687228.html