How to keep track of how many guesses the user makes and print a message that tells them they lose? Exit after 5 guesses.
num=$(( $RANDOM % 100 + 1 ))
while [ "$input" -ne "$num" ]; do
if [ "$input" -gt "$num" ]; then
echo "The number is too high."
read input
elif [ "$input" -lt "$num" ]; then
echo "The number is too low."
read input
fi
done
echo "Great, you picked the right number."