function _replace(){
basepath=$0
> $
i=1
while read line
do
echo "start===================================================================================" >> $
oldpath=`echo $line|awk '{print $1$2}'|sed 's/^\///g'`
newpath=`echo $line|awk '{print $3$4}'|sed 's/^\///g'`
echo $oldpath >> $
echo $newpath >> $
if [ "$oldpath" != "" ] && [ "$newpath" != "" ];then
refiles=`grep $oldpath -irl --include="*.$3" $2`
for refile in $refiles
do
sed -i 's#'$oldpath'#'$newpath'#ig' $refile
echo $refile >> $
done
fi
echo "end=====================================================================================" >> $
echo "=">> $
echo $i >> $
echo "=">> $
i=$(($i+1))
done < $1
}
basepath=$0
> $
i=1
while read line
do
echo "start===================================================================================" >> $
oldpath=`echo $line|awk '{print $1$2}'|sed 's/^\///g'`
newpath=`echo $line|awk '{print $3$4}'|sed 's/^\///g'`
echo $oldpath >> $
echo $newpath >> $
if [ "$oldpath" != "" ] && [ "$newpath" != "" ];then
refiles=`grep $oldpath -irl --include="*.$3" $2`
for refile in $refiles
do
sed -i 's#'$oldpath'#'$newpath'#ig' $refile
echo $refile >> $
done
fi
echo "end=====================================================================================" >> $
echo "=">> $
echo $i >> $
echo "=">> $
i=$(($i+1))
done < $1
}