blob: bb24e2a2f7e411ea36f9c7af0c13b16311b878c7 [file] [log] [blame]
Denys Vlasenkod2241f52020-10-31 03:34:07 +01001v='*.z'
2[[ a.z = *.z ]]; echo 1:YES:$?
3[[ a.z == $v ]]; echo 2:YES:$?
4
5# wildcards can match a slash
6[[ a/b = a*b ]]; echo 3:YES:$?
7[[ a/b == a?b ]]; echo 4:YES:$?
8
9# wildcards can match a leading dot
10[[ a/.b = a/*b ]]; echo 5:YES:$?
11[[ a/.b == a/?b ]]; echo 6:YES:$?
12
13# wildcards can be escaped
14[[ abc = a*c ]]; echo 7:YES:$?
15[[ abc == a\*c ]]; echo 8:no:$?