#! /bin/bash
echo "guest the num from 1 to 10"
read num
while [ $num != 5 ]
do
if [ $num -lt 5 ]
then
echo "Too small,try agin"
read num
elif [ $num -gt 5 ]
then
echo "Too large,try agin"
read num
fi
echo "bingo"
done

  

[root@lenny Desktop]# ./guest.sh 
guest the num from 1 to 10
4
Too small,try agin
5
bingo

  

相关文章:

  • 2021-11-25
  • 2022-01-28
  • 2022-01-17
  • 2021-06-09
  • 2021-07-30
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-12-03
  • 2021-12-03
  • 2022-12-23
  • 2021-05-29
相关资源
相似解决方案