For some reason I'm not getting the higher number patterns to work in this script.
#!/bin/bash
#
# guess_my_number.bash - my favorite number
echo "Can you guess my favorite number???"
echo -e -n "\n\n\033[32m Pick a number between 0 and 100 > "
read num
case $num in
[0-6] ) echo "You're close...but too low" ;;
[8-14] ) echo "You're close...but too high" ;;
[15-100] ) echo "You're nowhere near my favorite number...sorry, try again" ;;
7 ) echo "YOU GUESSED MY FAVORITE NUMBER!" ;;
* ) echo "You didn't pick a number between 1 and 100!" ;;
esac
If I change [8-14] to [8..14] I get the echo response if I type in 8 when running the script but any other number from 9-100 gives me the wildcard echo response. If it's [8-14] it gives me the wildcard response too. Like I said the [0-6] pattern gives it's echo statement and so does 7.
What is my problem here?