5 ms·
[[ ]] is effectively an entirely different parser than the surrounding shell, similar to (( )). so you can do things like [[ 1 < 2 ]] && echo true # where
by prussian 6y ago
[[ ]] is effectively an entirely different parser than the surrounding shell, similar to (( )).
so you can do things like
[[ 1 < 2 ]] && echo true # where < is now not redirect, like to (( 1 < 2 ))
[[ "x" == 'y' || x == x ]] # note how || is not behaving the same as [ '' || 'y' ]
`man 1 test` explains the more conventional `[ ]` where the bash man page would better explain the [[ case.