标签:文件名 hosts http arp host class vhosts div har
#!/bin/bash #在 servername 域名 字符串后面添加指定字符串 servername=`grep ServerName httpd-vhosts.conf |awk ‘{print $2}‘` for conf in $servername;do sed -i "/ServerName $conf/a\ErrorLog "logs/${conf}_error.log"" httpd-vhosts.conf sed -i "/ServerName $conf/a\CustomLog "logs/${conf}_access.log" common" httpd-vhosts.conf done 注: sed -i "/指定字符串/a(后)\增加的内容" 要修改的文件名称
标签:文件名 hosts http arp host class vhosts div har
原文地址:https://www.cnblogs.com/lixinliang/p/10245460.html