|
Re
Hi,
I posted this query after going thru man and searching thru the web for some time. It didn't make much sense
This is the part of my code ...
while getopts 'd:r:u:p:l' OPTION
do
case "$OPTION" in
d) SAVE_PATH="$OPTARG";;
r) DEST_IP="$OPTARG";;
u) USER_NAME="$OPTARG";;
p) PASSWORD="$OPTARG";;
l) LOCAL=TRUE;;
?) Usage # calls an error message generating function
esac
done
the problem that i am having is that if i give the pgm like this $xyz -d -r 1.2.3.4 -l, instead of giving an error saying that the argument for -d isn't provided it takes "-r" as the argument for "-d". what am i doing wrong here.
Thanks a lot,
Hari.
|