Anyone know why this happens? Is this a bug of bash?
x='mnt:[4026532411]'
[[ $x == $x ]] && echo OK
I am expecting result OK
, but it did not.
Of course, this works
[[ "$x" == "$x" ]] && echo OK
But as I know, bash [[ ]] have a merit that no need to quote var when compare.
x='a b'
[[ $x == $x ]] && echo OK
works.
Ironical things is
x='mnt:[4026532411]'
[[ $x != $x ]] && echo Oh my god
result is Oh my god