[ 1 >2 ] || [ 3>'aaa bb' ] # Simple example of problematic code
[ 1 -gt 2 ] || [ 3 \> 'aaa bb' ] # arithmetical, lexicographical
A word that looks like a redirection in simple shell commands causes it to be interpreted as a redirection. ShellCheck would guess that you don't want it in tests.
When it's among a continuous list of redirections at the end of a
simple test
command, it's more likely that the user really
meant to do a redirection. Or any other case that you mean to do
that.
ShellCheck is a static analysis tool for shell scripts. This page is part of its documentation.