SC1074 – ShellCheck Wiki

See this page on GitHub

Sitemap


Did you forget the ;; after the previous case item?

Problematic code:

while getoptions f option
do
  case "${options}"
  in
  f) FTR="${ARG}"
    \?) exit
  esac
done

Correct code:

while getoptions f option
do
  case "${options}"
  in
  f) FTR="${ARG}"
    \?) exit;;
  esac
done

Rationale:

Syntax case needs ;; after the previous case item. If not, syntax error will cause.


ShellCheck is a static analysis tool for shell scripts. This page is part of its documentation.