Suppose I have a code below .
while getopts a: opt
do
case $opt in
a) app_name="$OPTARG";;
*) echo "$opt is an invalid option";
exit 1;;
?) echo "The value of $OPTARG is an invalid option";
exit 1;;
esac
done
Could anyone please tell me in which case my script will give output for ? option . Suppose I run my script abc.sh containing this code like this :- sh abc.sh -a
The argument for a is null and I am getting output like ? is an invalid option .So in which case I should get output for ? opt (ie; The value of $OPTARG is an invalid option)