blob: ee01e5c3060656bae9ac24e69da72c583f01cb5c [file] [log] [blame]
Denys Vlasenko64981b42020-11-01 18:47:24 +01001v='*.z'
2[[ a.z = *.z ]]; echo 1:YES:$?
3[[ a.z = "*".z ]]; echo 2:no:$?
4[[ a.z == $v ]]; echo 3:YES:$?
5
6# Buggy:
7# the problem is that expansion rules of LHS and RHS of ~=
8# should not be the same: in RHS, "$v" and "*" should escape metas
9# (currently "$v" does not),
10# but in LHS, they should _not_ do that
11# (currently "*" does). Thus these cases fail:
12#[[ a.z == "$v" ]]; echo 4:no:$? # BUG: "$v" expands to *.z
13#[[ "*".z == ?.z ]]; echo 5:YES:$? # BUG: "*" expands to \*