1 SC1057
Vidar Holen edited this page 2022-10-19 20:28:02 -07:00

Did you forget the do for this loop?

Problematic code:

while read -r line
  echo $line
done

Correct code:

while read -r line
do
  echo $line
done

Rationale:

ShellCheck found a loop that appears to be missing its do statement. Make sure the loop syntax is correct.

Exceptions:

None.

  • Help by adding links to BashFAQ, StackOverflow, man pages, POSIX, etc!