SUMARY: ksh options help

From: Dave Markham (dave.markham@fjserv.net)
Date: Tue Jan 30 2007 - 12:42:43 EST


Thanks to vladimir, john, ceri, ric, christopher, brad, matthew

People were mentioning to use getopts which i had looked at, but the
result which seems to work nicely is to use a case within a case.

Specifically mathew stier and Ric Anderson suggested this :-

-config_file)
        ## Below is getting messy. Look at getopts ##
        case "$2" in
        ''|-*)
                usage
                exit 1
        ;;
        esac
        shift
        config_file=$1
        ;;

and

-config_file)
       case "$2" in
               -* | "" )
                       usage;
                       exit 1;
                       ;;
               * )
                       shift;
                       config_file=$1;
                       ;;
       esac
       ;;

work :)
_______________________________________________
sunmanagers mailing list
sunmanagers@sunmanagers.org
http://www.sunmanagers.org/mailman/listinfo/sunmanagers



This archive was generated by hypermail 2.1.7 : Wed Apr 09 2008 - 23:41:33 EDT