4 while getopts :ab: name "$@"
10 :) echo $0: error: option \`$OPTARG\' requires an argument
11 echo Usage: $0 [-a] [-b value] args
13 ?) echo $0: error: illegal option character \`$OPTARG\'
14 echo Usage: $0 [-a] [-b value] args
20 if [ ! -z "$aflag" ] ; then echo -a specified ; fi
21 if [ ! -z "$bflag" ] ; then echo -b $bval specified ; fi
23 if [ "$OPTIND" -gt 1 ]
25 shift $(( $OPTIND - 1 ))
28 echo remaining args: "$*"