![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Using getopts | TurboArkhan | Shell Programming and Scripting | 3 | 06-22-2009 04:31 PM |
| Help in getopts | chella | Shell Programming and Scripting | 4 | 11-02-2007 01:09 AM |
| help in getopts | problems | Shell Programming and Scripting | 1 | 05-04-2006 11:07 PM |
| getopts | yerra | Shell Programming and Scripting | 5 | 03-26-2005 10:43 AM |
| getopts | Shell Programming and Scripting | 3 | 12-05-2002 07:42 PM | |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
getopts help
Hi
i have part of the scripts below ,getopt for -h or ? not working for me. can anybody tell me if this sytax right or wrong. #!/usr/bin/ksh program=$(basename $0) ##################################################################################### function usageerr { RC=1 USAGE="$program -s PROD_SCHEMA_NAME -d DEST_SCHEMA_NAME " echo " usage:\n $USAGE " exit $RC } ###################################################################################### while getopts s:d:h arguments do case $arguments in s|S) SRCE_SCHEMA_NAME=$OPTARG;; d|D) DEST_SCHEMA_NAME=$OPTARG ;; h|H|?) usageerr ;; *) echo " $program :$OPTARG requires a value." ;; esac done shift $(($OPTIND -1)) if [[ $# -le 1 ]] then echo " Incorrect number of arguments " usageerr fi Thanks u Last edited by GrepMe; 06-20-2007 at 08:50 AM.. |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|