Hi, all,
I have a simple script where I would like to use getopt long option, seems it can't work on ASUSwrt, do you have any idea?
Here is the simplified script:
If I change the getop to "-o ucmo", then in the do case use the one-letter options, it works.
I have a simple script where I would like to use getopt long option, seems it can't work on ASUSwrt, do you have any idea?
Here is the simplified script:
Bash:
#!/usr/sh
args=$(getopt -l us,ca,mx,misc -- "$@")
if [ $? != 0 ] ; then echo "Terminating..." >&2 ; exit 1 ; fi
eval set -- "$args"
while :; do
case "$1" in
--us)
echo "us"
shift;;
--ca)
echo "ca"
shift;;
--mx)
echo "mx"
shift;;
--misc)
echo "misc"
shift;;
--)
echo "--"
shift
break
;;
*)
echo "??"
shift
;;
esac
done
If I change the getop to "-o ucmo", then in the do case use the one-letter options, it works.