2 SC1061
Joachim Ansorg edited this page 2021-11-12 10:39:29 +01:00

Couldn't find done for this do.

Problematic code:

yes() {
  while echo "y"
  do
    true
}

Correct code:

yes() {
  while echo "y"
  do
    true
  done
}

Rationale:

ShellCheck found a do without a corresponding done.

Double check that the done exists, and that it correctly matches the indicated do. A companion warning SC1062 is emitted where ShellCheck first noticed it was missing.

Exceptions:

None.