SC1061 – ShellCheck Wiki

See this page on GitHub

Sitemap


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.


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