Is there a way to pass more than one option when running a script?
My script has this case:
case "$1" in
b)
backup_start $1
;;
h)
_usage
;;
*)
echo 'Invalid option, -h for help'
;;
esac
I run my script with:
myscript -b backupname
But sometimes I would like to run the script with an option with another argument...that I will then use in case inside the script:
myscript -b backupname -t mynewarg
getops-using code only cares aboutt, not aboutb. And you don't useMYINTERNALENVanywhere, and you still don't cite where you have this code from./usr/share/doc/util-linux/examples/getopt-example.bashexample? you should read that-b xxxxyou onlyshiftrather thanshift 2since-btakes a supplementary argument