SC1060 – ShellCheck Wiki

See this page on GitHub

Sitemap


Can't have empty do clauses (use true as a no-op)

Problematic code:

for i in 1 2 3; do
done

Correct code:

for i in 1 2 3; do
  true
done

Rationale:

An empty do ... done block is not valid. Use true or : if you need no command at all.

Exceptions:

None.


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