]. Missing
semicolon/linefeed?Note: Removed in V0.7.2 2021-04-20
if [ -e "foo.txt" ]: then
echo "Exists"
fiif [ -e "foo.txt" ]; then
echo "Exists"
fiShellCheck found unexpected characters after the ] or
]] in a test expression. In the example, a
colon was accidentally used instead of a semicolon.
Similarly, a missing space before a comment
([ -e foo ]#comment), an additional square bracket
([[ -e foo ]]]), or a missing semicolon before a
then on the same line (if [ foo ]then) can
cause this warning.
Make sure the ] or ]] is not immediately
followed by another shell word character.
None
ShellCheck is a static analysis tool for shell scripts. This page is part of its documentation.