]
outside test. Add missing [
or
quote if intentional.if foo -eq bar ]; then true; fi
or
tr -d ]
if [ foo -eq bar ]; then true; fi
or
tr -d ']'
ShellCheck found a non-test command that ends with ]
or
]]
.
If this was intended to be a test expression like in the first
example, add the missing [
or [[
.
If the ]
was intended to be literal, like in
tr -d ]
, you can quote to make this obvious.
tr -d ]
is valid and not different from
tr -d ']'
, so in these cases you can ignore the error
instead.
ShellCheck is a static analysis tool for shell scripts. This page is part of its documentation.