Is this the correct way to get and set with OPTS?
I want to be able to take in a lot of options like
./runthis.sh --option1 setuff --option2 setmorestuff
while :
do
case $1 in
-h | --help | -\?)
usage
exit 0
;;
-o | --option1)
O=$2
shift 2
;;
-z | --option2)
Z=$2
shift 2
;;
--) # End of all options
shift
break
;;
-*)
echo "WARN: Unknown option (ignored): $1" >&2
shift
;;
*) # no more options. Stop while loop
break
;;
esac
done