#! /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
[[email protected] Desktop]# ./guest.sh guest the num from 1 to 10 4 Too small,try agin 5 bingo
时间: 2024-12-17 05:55:52