Skip to content
koalaman edited this page Jul 9, 2017 · 3 revisions

Don't put semicolons directly after 'then'.

Problematic code:

if true; then; echo "Hi"; fi

Correct code:

if true; then echo "Hi"; fi

Rationale:

then keywords should not be followed by semicolons. It's not valid shell syntax.

You can follow them directly with a line break or another command.

Exceptions:

None

Clone this wiki locally

⌂ 换网址