3 ms·
Well techincally... the == and != operator matches the LHS against the pattern on the RHS. So [[ $a == "$b" ]] works. $ shellcheck oops.sh In oop
by yrro 4y ago
Well techincally... the == and != operator matches the LHS against the pattern on the RHS.
So [[ $a == "$b" ]] works.
$ shellcheck oops.sh
In oops.sh line 4:
[[ $a == $b ]]
^-- SC2053 (warning): Quote the right-hand side of == in [[ ]] to prevent glob matching.
For more information:
https://www.shellcheck.net/wiki/SC2053 -- Quote the right-hand side of == i...
Unlike the bugs that the x$var works around this is all in the manual!
https://www.gnu.org/software/bash/manual/bash.html#index-_005b_005b https://www.gnu.org/software/bash/manual/bash.html#index-_00...