I am writing a script using getopt to parse parameters. The solution I have so far only accepts one parameter. Is there a way to make this solution accept multiple parameters (eg. both '-f and -l)?
solution in link does not work for me. Bash getopt accepting multiple parameters
code: '''
while getopts "f:l:" option; do
case "${option}" in
f) firstdate=${OPTARG}
shift
;;
l) lastdate=${OPTORG}
;;
*)
echo "UsageInfo"
exit 1
;;
esac
shift
done
'''