3 ms·
Whether or not it should, it may fail for any kind of glob. This could be either because the glob ends up unintentionally matching something: $ var='*'; t
by koala_man 6y ago
Whether or not it should, it may fail for any kind of glob.
This could be either because the glob ends up unintentionally matching something:
$ var='*'; touch xfoo xbar
$ [ x$var == x"hello" ]
bash: [: too many arguments
$ var="Rocky_[1976].jpg"; touch xRocky_7.jpg
$ [ x$var == x"Rocky_[1976].jpg" ]
(false, should be true)
or because you have something like nullglob or failglob enabled:
$ var="Rocky_[1976].jpg"; shopt -s nullglob
$ [ x$var == x"hello" ]
bash: [: ==: unary operator expected