![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Rules & FAQ | Contribute | Members List | Arcade | 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 here. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| what is the right syntax ?? | convenientstore | Shell Programming and Scripting | 7 | 06-04-2007 01:21 AM |
| csh syntax | charlie11k | UNIX for Dummies Questions & Answers | 0 | 05-31-2007 11:29 PM |
| vim and syntax max os | kezzol | OS X (Apple) | 1 | 04-30-2007 11:22 AM |
| Help with the syntax | chandhar | Shell Programming and Scripting | 2 | 03-25-2007 10:48 PM |
| What does this syntax mean... | DrAwesomePhD | UNIX for Dummies Questions & Answers | 1 | 07-31-2006 08:54 AM |
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
|
Help with the syntax
can anyone explain the code for me... i am new to shell programming
while getopts ":S:D:U:" OPTION "$@" do case $OPTION in S) SRVR=$OPTARG;; D) DB="$OPTARG"; USEDB="use $OPTARG";; U) UID=$OPTARG;; :) MISSINGOPTARG="$MISSINGOPTARG -$OPTARG";; ?) if [ "$OPTARG" = "?" ] then HELP=1 else UNEXPECTEDOPT="$UNEXPECTEDOPT -$OPTARG"; fi;; esac done |
| Forum Sponsor | ||
|
|
|
|||
|
HI,
Code:
while getopts ":S:D:U:" OPTION "$@" --->The possible options are specified
here
do
case $OPTION in
S) SRVR=$OPTARG;; -->Handling the option S -->OPTARG will have the
value for the oprion S
D) DB="$OPTARG"; USEDB="use $OPTARG";;
U) UID=$OPTARG;;
:) MISSINGOPTARG="$MISSINGOPTARG -$OPTARG";;
?) if [ "$OPTARG" = "?" ]
then
HELP=1
else
UNEXPECTEDOPT="$UNEXPECTEDOPT -$OPTARG";
fi;;
esac --->End of switch /case
done
Raghuram Last edited by vgersh99; 03-26-2007 at 04:47 AM. Reason: vB Codes |