echo "Guess game. What is the number I'm thinking about?" num=$(($(($RANDOM % 20))+1)) ex=1 while [ 1 -eq $ex ] do read usr if [ $num == $usr ] then echo "Great it is $num" ex=0 else echo "No, it is not that number" fi done