pmcmicha
Technical User
- May 25, 2000
- 353
I am running the following command, but I can not getting a return value from getopts. I am on SCO Unixware 7.1.1 and running KSH 93.
#!/usr/bin/ksh -p
while getopts ":b:d:" ARG
do
case $ARG in
b)
COUNT=0
FCOUNT=2
;;
d)
COUNT=0
FCOUNT=1
;;
p)
COUNT=1
FCOUNT=2
;;
*)
USAGE # This is a function to inform users.
;;
esac
done
shift $(($OPTIND - 1))
OPT=$@
The script only takes one of the above options at a time.
Thanks in advance.
#!/usr/bin/ksh -p
while getopts ":b:d:" ARG
do
case $ARG in
b)
COUNT=0
FCOUNT=2
;;
d)
COUNT=0
FCOUNT=1
;;
p)
COUNT=1
FCOUNT=2
;;
*)
USAGE # This is a function to inform users.
;;
esac
done
shift $(($OPTIND - 1))
OPT=$@
The script only takes one of the above options at a time.
Thanks in advance.