[[ 0=1 ]]
[[ 0 = 1 ]]
[[ 0 = 1 ]] means "check if 0 and 1 are equal".
[[ str ]] is short form for
[[ -n str ]], and means "check if
str is non-empty". It doesn't matter if
str happens to contain
Always use spaces around the comparison operator in
[..](..), otherwise it won't be recognized as an operator.
ShellCheck is a static analysis tool for shell scripts. This page is part of its documentation.