Skip to content
flyxyz123 edited this page Feb 28, 2024 · 5 revisions

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

Each individual ShellCheck warning has its own wiki page like S001. Use GitHub "Pages" feature above to find a specific one, or see Checks.

Clone this wiki locally