#bash:
Inside double square brackets, == and != are not string equivalence tests, but glob pattern match tests, i.e. «[[ x == ? ]]» returns 0.
You can quote the right-hand-side to escape metacharacters: «[[ $X == ‘?’ ]]»
Music-obsessed software geek. One of Breakmaster Cylinder’s Internet weirdos. He/him.
#bash:
Inside double square brackets, == and != are not string equivalence tests, but glob pattern match tests, i.e. «[[ x == ? ]]» returns 0.
You can quote the right-hand-side to escape metacharacters: «[[ $X == ‘?’ ]]»