-
Notifications
You must be signed in to change notification settings - Fork 1.8k
SC1136
Vidar Holen edited this page Oct 14, 2019
·
1 revision
if [ -e "foo.txt" ]: then
echo "Exists"
fi
if [ -e "foo.txt" ]; then
echo "Exists"
fi
ShellCheck 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
- Help by adding links to BashFAQ, StackOverflow, man pages, POSIX, etc!