一句話實現bash
# grep '211.345' ./*/* |awk -F : '{system("sed -i s/211.345/211.888/g " $1)}'ide
腳本實現xml
#!/bin/bash it
old="$1"class
new="$2"awk
for item in $(find -name "*.xml" -exec grep "$1" {} \;)sed
do grep
backup="${item}.bak"腳本
cp -f "$item" "$backup"註釋
sed -e s/$old/$new/g $backup > $item
#rm -rf $backup####刪除備份文件去掉註釋######
done