-
Notifications
You must be signed in to change notification settings - Fork 1.8k
SC2213
koalaman edited this page May 28, 2017
·
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.