eval last='$'${#}
while [ $# -gt 1 ] # process arguments
do
	case $1 in
		short)
			short=on
			;;
		quick)
			quick=on
			;;
		trace)
			set -xv
			;;
		jerk)
			jerks=1
			;;
		$last)	echo "hey, $1 is the same as \$last"
			shift # or break #or continue
			;;
		-*)	echo "$1 is an arg!!"
			shift
			continue
			;;
		*)	echo "what the heck is $1?"
			shift
			continue
			;;
	esac
	echo FIELD $1
	shift
done
echo LAST $last

exit

optproc ()
{
#set -x
option="$*"
for loop in `echo $option|awk '{
	for (count=1; count <= length($0); count++){
		print substr($0,count,1)}}'`
	do
		case $loop in
			"-")	;;
			"a")	all=alldeltas;;
			"c")	vicatcmd=cat;;
			"o")	dirs="/TMlmos/TMlmos/src";;
			"p")	vicatcmd=pg;;
			"v")	vicatcmd=vi;;
			[1-9]*)	del="-r`echo $*|
				sed 's/[^0-9.]//g'`"
				break;;
			*)	echo "bad option, only -[aopcv][delta] allowed"
				exit 1;;
		esac
done
}
optproc $*
echo $all ALL $vicatcmd VICAT $dirs DIRS $del DEL

exit

#EXTENDED REGULAR EXPRESSIONS DON'T WORK
#Case uses pathname completion.  However, here is the work-around:

mc=`echo $1|grep "^[0-9]\{1,3\}$"`
case $1 in
	$mc) echo valid;;
	*) echo invalid;;
esac
