clear
echo ""
while true
do
echo "请输入现在的数据库名:"
read dbold
if [ "$dbold" = "" ]
then
echo "错误的数据库名,请重输!"
else
break
fi
done
echo ""
while true
do
echo "请输入现在的数据库名:"
read dbold
if [ "$dbold" = "" ]
then
echo "错误的数据库名,请重输!"
else
break
fi
done
while true
do
echo "请输入新的数据库名:"
read dbnew
if [ "$dbnew" = "" ]
then
echo "错误的数据库名,请重输!"
else
break
fi
done
do
echo "请输入新的数据库名:"
read dbnew
if [ "$dbnew" = "" ]
then
echo "错误的数据库名,请重输!"
else
break
fi
done
echo "正在更换程序中的数据库名,请稍候。。。"
for i in program/tj_globals.4gl
do
sed -e "s/DATABASE $dbold/DATABASE $dbnew/g" < $i >$i.a
mv $i.a $i
done
for i in form/*per
do
sed -e "s/DATABASE $dbold/DATABASE $dbnew/g" < $i >$i.a
mv $i.a $i
done
for i in ywprg/yw_globals.4gl
do
sed -e "s/DATABASE $dbold/DATABASE $dbnew/g" < $i >$i.a
mv $i.a $i
done
do
sed -e "s/DATABASE $dbold/DATABASE $dbnew/g" < $i >$i.a
mv $i.a $i
done
for i in sumprg/sum_globals.4gl
do
sed -e "s/DATABASE $dbold/DATABASE $dbnew/g" < $i >$i.a
mv $i.a $i
done
do
sed -e "s/DATABASE $dbold/DATABASE $dbnew/g" < $i >$i.a
mv $i.a $i
done
echo "更换程序中的数据库名完毕!!!"
本文转自ipist 51CTO博客,原文链接:http://blog.51cto.com/ipist/11118
,如需转载请自行联系原作者