-
Notifications
You must be signed in to change notification settings - Fork 1.8k
SC2213
Vidar Holen edited this page Apr 26, 2018
·
4 revisions
while getopts "vrn" n
do
case "$n" in
v) echo "Verbose" ;;
r) echo "Recursive" ;;
\?) usage;;
esac
done
while getopts "vrn" n
do
case "$n" in
v) echo "Verbose" ;;
r) echo "Recursive" ;;
n) echo "Dry-run" ;; # -n handled here
\?) usage;;
esac
done
You have a while getopts
loop where the corresponding case
statement fails to handle one of the flags.
Either add a case to handle the flag, or remove it from the getopts
option string.
None.