case statement question...
Hello all - I have a KSH script question...
Can someone out there take a look at this script. I want to perform an
operation based on the day of month. but the days (10 - 31) are giving
me a problem. I would really like to keep this a one liner if i can. How
bout anybody out there done something like this ???
Only the line [30-31] is the offending line...
#!/bin/ksh
echo "Enter the date: (ie Nov 04)"
read Month Day
case $Day in
1 | 01 ) Day=01; SearchStr="$Month 1";;
2 | 02 ) Day=02; SearchStr="$Month 2";;
3 | 03 ) Day=03; SearchStr="$Month 3";;
4 | 04 ) Day=04; SearchStr="$Month 4";;
5 | 05 ) Day=05; SearchStr="$Month 5";;
6 | 06 ) Day=06; SearchStr="$Month 6";;
7 | 07 ) Day=07; SearchStr="$Month 7";;
8 | 08 ) Day=08; SearchStr="$Month 8";;
9 | 09 ) Day=09; SearchStr="$Month 9";;
[30-31]) SearchStr="$Month $Day";;
*) ERROR;; # call error routine
esac
echo $SearchStr
i guess i could use the following statements below but I want to know if
I can use a 10-31 as a qualifier...
# [12][0-9]) SearchStr="$Month $Day";;
# 30 | 31 ) Day=02; SearchStr="$Month 9";;
thanks in advance ...
--
TO UNSUBSCRIBE FROM THIS MAILING LIST: e-mail the word "unsubscribe" to
debian-user-request@lists.debian.org .
Trouble? e-mail to templin@bucknell.edu .
Reply to: