breakis only valid in loops
case "$1" in ) -vverbose=1 break ;; ) -ddebug=1 esac
case "$1" in ) -vverbose=1 ;; ) -ddebug=1 esac
continue was found outside a loop. These statements are only valid in loops. In particular,
break is not required in
case statements as there is no implicit fall-through.
To return from a function or sourced script, use
return. To exit a script, use
It's possible to
continue in a function without a loop. The call will then affect the loop -- if any -- that the function is invoked from. This is obviously not good coding practice.
ShellCheck is a static analysis tool for shell scripts. This page is part of its documentation.