I am following IBM's example from their website:
(listing #5) http://www.ibm.com/developerworks/library/l-bash-parameters/index.html
#!/bin/bash
echo "OPTIND starts at $OPTIND"
while getopts ":pq:" optname
do
case "$optname" in
"p")
echo "Option $optname is specified"
;;
"q")
echo "Option $optname has value $OPTARG"
;;
"?")
echo "Unknown option $OPTARG"
;;
":")
echo "No argument value for option $OPTARG"
;;
*)
# Should not occur
echo "Unknown error while processing options"
;;
esac
echo "OPTIND is now $OPTIND"
done
All I want to to is have an option whose name is more than 1 letter. ie -pppp and -qqqq instead of -p and -q.
I have written my program and implementing -help is giving me a problem...