break和continue的用法
时间:2010-09-13 来源:xindi10631
#!/bin/sh
while :
do
echo -n "Enter number 1 to 5:"
read NUM
case $NUM in
1|2|3|4|5)
echo "OK you enter num $NUM" ;;
*)
echo -e "NO.continue(y|n):\c"
read info
case $info in
y|Y)
continue
;;
n|N)
break
;;
esac
;;
esac
done
while :
do
echo -n "Enter number 1 to 5:"
read NUM
case $NUM in
1|2|3|4|5)
echo "OK you enter num $NUM" ;;
*)
echo -e "NO.continue(y|n):\c"
read info
case $info in
y|Y)
continue
;;
n|N)
break
;;
esac
;;
esac
done
相关阅读 更多 +