5 SC1074
flyxyz123 edited this page 2024-02-28 11:46:15 +00:00

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.