I am working on a bash script, and I decided to use getopts to get the options, but the loop I used doesn't work! Could someone please help me?
while getopts "u:p:k:s:t:c:l:" flag
do
echo $flag
case "$flag" in
k) APIKEY="$OPTARG"
;;
s) APISECRET="$OPTARG"
;;
u) USERNAME="$OPTARG"
;;
p) PASSWORD="$OPTARG"
;;
t) TITLE="$OPTARG"
;;
c) CATEGORY="$OPTARG"
;;
l) LANGUAGE="$OPTARG"
;;
esac
done
shift $((OPTIND-1))
None of the above variables are being set.