Denys Vlasenko | d2241f5 | 2020-10-31 03:34:07 +0100 | [diff] [blame] | 1 | v='*.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:$? |