Case statement

From: William (fred_at_nosmapherethankyou.com)
Date: 05/31/05


Date: Tue, 31 May 2005 12:04:48 +0000 (UTC)

Hi,

I'm a bit stuck with the below case statement, I'm looking at taking input
from a user using read command, then evaluating this string to see if it is
either within a certain numeric range i.e. 100-60000. However when I try to
specify a range it's not working. If I input 100, I get something else
returned, I'm quite new to shell scripting and I guess I've not written the
numeric range correctly?

VARIABLE=
while [ -z $VARIABLE ]
do
        echo "Enter a Value: \c"
        read VARIABLE
done

case $VARIABLE
        in
        [100-60000])
        echo
        echo "Numeric between 100-60000"
;;

        *)
        echo
        echo "Something else"
;;
esac

--
Regards
William

Quantcast