Case statement
From: William (fred_at_nosmapherethankyou.com)
Date: 05/31/05
- Next message: rajashekar14_at_yahoo.com: "Re: How to read text from a file in shell scripting"
- Previous message: Loki Harfagr: "Re: How to read text from a file in shell scripting"
- Next in thread: Dale Hagglund: "Re: Case statement"
- Reply: Dale Hagglund: "Re: Case statement"
- Reply: joe_at_invalid.address: "Re: Case statement"
- Reply: Bill Marcum: "Re: Case statement"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
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
- Next message: rajashekar14_at_yahoo.com: "Re: How to read text from a file in shell scripting"
- Previous message: Loki Harfagr: "Re: How to read text from a file in shell scripting"
- Next in thread: Dale Hagglund: "Re: Case statement"
- Reply: Dale Hagglund: "Re: Case statement"
- Reply: joe_at_invalid.address: "Re: Case statement"
- Reply: Bill Marcum: "Re: Case statement"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]