This is my first attempt using getopts, and so far it hasn't been working for me. The code in my script is:
while getopts "s:" opt; do
case $opt in
s) subj=$OPTARG;;
\?) echo "Incorrect usage";;
esac
done
echo ""
echo $subj
When I try to run to script like this:
myScript.sh -s 100
I want it to echo the subject id number I've specified. So far though it just gives me a blank statement.