shell读取文本内容进行替换再写会文本

#1bin.bash
filename="/home/song/my.txt"
while read line
do
echo $line | grep -w  "nice" | sed -e   's/nice//g' -e 's/hello/no/g'>mynew.txt
done < $filename

 

你可能感兴趣的:(读写文件,shel)