请教LINUX的 编程问题!!
1)
#!/bin/bash
clear
function dis
{ echo "*****************communication mode**********************"
echo " "
echo "pls select a number:"
echo " "
echo "1.list the e-mail address "
echo " "
echo "2.list the namelist &telephone number "
echo " "
echo "q=quit "
echo " "
echo "Q=quit "
echo " "
read no
case $no in
1)echo "gaya208@hotmail.com"
echo "gaya208@163.com"
echo "amy@21cn.com"
echo "prince@sina.com.cn"
;;
2)echo "gaya208 -- 38256286"
echo "gaya -- 13642330469"
echo "amy -- 36346262"
echo "prince -- 13822111534"
;;
q)exit 0
;;
Q)exit 0
;;
*)echo "sorry! your selection isn't in the list!it is a invalid no."
esac
}
dis
这个是 可以运行的.但是下面的 这个就不可以了.请帮我看看是 什么原因!!
2)
#! /bin/bash
declare flag="3"
while["$flag" -gt "1"]
do
clear
echo "*****************communication mode**********************"
echo " "
echo "pls select a number:"
echo " "
echo " 1.list the e-mail address "
echo " "
echo " 2.list the namelist &telephone number "
echo " "
echo " q=quit "
echo " "
echo " Q=quit "
echo " "
read no
case $no in
1)echo "gaya208@hotmail.com"
echo "gaya208@163.com"
echo "amy@21cn.com"
echo "prince@sina.com.cn"
;;
2)echo "gaya208 -- 38256286"
echo "gaya -- 13642330469"
echo "amy -- 36346262"
echo "prince -- 13822111534"
;;
q)$flag=0
;;
Q)$flag=0
;;
*)echo "sorry! it is a invalid no."
echo " pls try again!!"
esac
done