1 #********************************************************************* 2 # Function to validate and interpret user options on the cmd line. * 3 #********************************************************************* 4 option_sub() { 5 6 verbose="no" ; vflag="" ; file_flag=no # Set defaults for options 7 8 while getopts :vf: optname 9 do 10 #echo "name=\"$optname\" IND=\"$OPTIND\" ARG=\"$OPTARG\"" 1>&2 11 case $optname in 12 v ) 13 verbose="yes" ; vflag="-v" 14 ;; 15 f ) 16 file_flag=yes ; mac_file="$OPTARG" 17 ;; 18 * ) 19 emsg "Unknown option $name" 20 usage ; exit 3 21 ;; 22 esac 23 done #09 |