4 while getopts ab: name -a -b 1 -a -a -a -b 5 -b 3 -a one two three four five
10 ?) echo Usage: $0 [-a] [-b value] args
16 if [ ! -z "$aflag" ] ; then echo -a specified ; fi
17 if [ ! -z "$bflag" ] ; then echo -b $bval specified ; fi
19 set -- -a -b 1 -a -a -a -b 5 -b 3 -a one two three four five
20 if [ "$OPTIND" -gt 1 ]
22 shift $(( $OPTIND - 1 ))
25 echo remaining args: "$*"