I want to read in arguments from command line and store that in a variable.

so I have a program call mycal, and it takes in many arguments:

mycal jan - jun 2004 aug 1992

so I want to read in all those arguments, when it sees the dash '-', sets a flag, and store the previous argument "jan" and the next argument "jun" into the variable. I already have another script that translate jan to 1 and jun to 6, etc..

for example,

the var MONTH would have { 1 2 3 4 5 6 }

this is what I have so far:

for m in $*
do
ARG=`name2num $m`
echo $ARG
if test $m = -
then
DASH=TRUE
elif test $ARG != error && DASH == TRUE
MONTH = "$MONTH $ARG"
fi
done


Thanks.