Denys Vlasenko | 8de5b9f | 2018-02-13 14:43:29 +0100 | [diff] [blame] | 1 | # Case argument is globbed, match patterns are not. |
2 | # This caught some bugs in the past. | ||||
3 | |||||
4 | case z in | ||||
5 | \z ) echo ok1 ;; | ||||
6 | * ) echo BUG ;; | ||||
7 | esac | ||||
8 | case \z in | ||||
9 | z ) echo ok2 ;; | ||||
10 | * ) echo BUG ;; | ||||
11 | esac | ||||
12 | case \z in | ||||
13 | \z ) echo ok3 ;; | ||||
14 | * ) echo BUG ;; | ||||
15 | esac | ||||
16 | case z in | ||||
17 | \z ) echo ok4 ;; | ||||
18 | * ) echo BUG ;; | ||||
19 | esac | ||||
20 | case \\z in | ||||
21 | \\z ) echo ok5 ;; | ||||
22 | * ) echo BUG ;; | ||||
23 | esac | ||||
24 | echo Ok:$? | ||||
25 | |||||
26 | case "\z" in | ||||
27 | "\z" ) echo ok6 ;; | ||||
28 | * ) echo BUG ;; | ||||
29 | esac | ||||
30 | case "\\z" in | ||||
31 | "\\z" ) echo ok7 ;; | ||||
32 | * ) echo BUG ;; | ||||
33 | esac | ||||
34 | case "\\\z" in | ||||
35 | "\\\z") echo ok8 ;; | ||||
36 | * ) echo BUG ;; | ||||
37 | esac | ||||
38 | echo Ok:$? |