利用case语句查表
时间:2008-08-13 来源:tchmuzi
cat cktab.sh
echo "###########Table Of Contents##########"
echo Check Table basetab_pps_his..........1
echo Check Table iuser_userrentsrv........2
echo Check Table mvpn_phone...............3
echo Check Table basetab_mvpn.............4
echo Exit Menu............................5
echo ""
echo "Please Input Number :\c"
read choice
case $choice in
1) echo "Please input msisdn number :\c"
read msisdn
echo "select * from basetab_pps_his where msisdn='${msisdn}'"|dbaccess insms20
;;
2) echo "Please input msisdn number :\c"
read msisdn
echo "select * from iuser_userrentsrv where msisdn='${msisdn}'"|dbaccess insms20
;;
3) echo "Please input isdnnumber number :\c"
read msisdn
echo "select * from mvpn_phone where isdnnumber='${msisdn}'"|dbaccess insms20
;;
4) echo "Please input groupnumber :\c"
read msisdn
echo "select * from basetab_mvpn where groupnumber='${msisdn}'"|dbaccess insms20
;;
q|Q|5) echo Goodbye;;
*) echo illegal Option
esac
echo "###########Table Of Contents##########"
echo Check Table basetab_pps_his..........1
echo Check Table iuser_userrentsrv........2
echo Check Table mvpn_phone...............3
echo Check Table basetab_mvpn.............4
echo Exit Menu............................5
echo ""
echo "Please Input Number :\c"
read choice
case $choice in
1) echo "Please input msisdn number :\c"
read msisdn
echo "select * from basetab_pps_his where msisdn='${msisdn}'"|dbaccess insms20
;;
2) echo "Please input msisdn number :\c"
read msisdn
echo "select * from iuser_userrentsrv where msisdn='${msisdn}'"|dbaccess insms20
;;
3) echo "Please input isdnnumber number :\c"
read msisdn
echo "select * from mvpn_phone where isdnnumber='${msisdn}'"|dbaccess insms20
;;
4) echo "Please input groupnumber :\c"
read msisdn
echo "select * from basetab_mvpn where groupnumber='${msisdn}'"|dbaccess insms20
;;
q|Q|5) echo Goodbye;;
*) echo illegal Option
esac
相关阅读 更多 +