close
先利用find 找出.cpp 檔 ( 依情況)
#!/bin/bash
# find out all files to replace
FILES=`find . -name '*.cpp'`
# string for replace from
OldStr='reg(R1'
# string for replace to
NewStr='reg(ARM::R1'
# files to replace
for file in $FILES
do
echo $file
if [ -f $file ];then
sed s/$OldStr/$NewStr/ $file > $file.tmp
mv $file.tmp $file -f
else
echo "file $file not exist!"
fi
done
全站熱搜
留言列表