2 SC1059
Joachim Ansorg edited this page 2022-10-31 15:03:37 +01:00

Semicolon is not allowed directly after do. You can just delete it.

Problematic code:

while true; do; true; done

while true;
do;
  true;
done;

Correct code:

while true; do true; done

while true;
do
  true;
done;

Rationale:

Semicolon ; is not allowed directly after a do keyword. Follow it directly with either a command or a linefeed as shown in the example.

Exceptions:

None.

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