歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Unix知識 >> 關於Unix >> 將指定文件列表中的文件內容逐個替換成想要的內容的小腳本

將指定文件列表中的文件內容逐個替換成想要的內容的小腳本

日期:2017/3/6 15:29:15   编辑:關於Unix

#!/bin/sh
#
#author coffee_45
#This programme is used to replace the charactor what you want .
#將指定文件列表中的文件內容逐個替換成想要的內容
echo "Enter the owner:"
read OWNER
while read LINE
do
sed 's/@test.com/@proxy.com/g' $LINE > $LINE.bak
cp -f $LINE.bak $LINE
chown $OWNER $LINE
done < ./web.txt

Copyright © Linux教程網 All Rights Reserved