sed用法
时间:2006-03-28 来源:supersuper
新版本的sed(GNU sed version 4.0.5)带有-i选项,允许直接编辑修改文件内容而不需要重定向到临时文件
例如:
/home/lee#cat file
old
abc
/home/lee#sed -i 's/old/new/' file
/home/lee#cat file
new
abc
sed -i "s:school:${School_name}:g" /var/named/chroot/etc/named.conf
例如:
/home/lee#cat file
old
abc
/home/lee#sed -i 's/old/new/' file
/home/lee#cat file
new
abc
sed -i "s:school:${School_name}:g" /var/named/chroot/etc/named.conf
相关阅读 更多 +