shell脚本猜0到100之间的随机数
#!/bin/bash
echo "input a number between 1 and 100"
let num=$((RANDOM %100))
# echo $num
while true
do
read guess
if [ $guess -lt $num ]
then echo "you should guess bigger!"
elif [ $guess -gt $num ]
then echo "you should guess smaller!"
else
echo "you are right!"
break
fi
done