SC1069 – ShellCheck Wiki

See this page on GitHub

Sitemap


You need a space before the [.

Problematic code:

if[ -e file ]
then echo "exists"; fi

Correct code:

if [ -e file ]
then echo "exists"; fi

Rationale:

ShellCheck found a keyword immediately followed by a [. There needs to be a space between them.

Exceptions:

None


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