运维网's Archiver
论坛
›
Shell/Powershell
› shell读取文本内容进行替换再写会文本
xiaoyu28
发表于 2018-8-25 09:23:00
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
页:
[1]
查看完整版本:
shell读取文本内容进行替换再写会文本