]>
Commit | Line | Data |
---|---|---|
8868edaf CR |
1 | # This program is free software: you can redistribute it and/or modify |
2 | # it under the terms of the GNU General Public License as published by | |
3 | # the Free Software Foundation, either version 3 of the License, or | |
4 | # (at your option) any later version. | |
5 | # | |
6 | # This program is distributed in the hope that it will be useful, | |
7 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | |
8 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
9 | # GNU General Public License for more details. | |
10 | # | |
11 | # You should have received a copy of the GNU General Public License | |
12 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | |
13 | # | |
a0c0a00f | 14 | olddir=$PWD |
d233b485 CR |
15 | : ${TMPDIR:=/var/tmp} |
16 | EMPTY=$TMPDIR/empty | |
a0c0a00f | 17 | |
ac50fbac CR |
18 | shopt -s globstar |
19 | s() | |
20 | { | |
21 | printf '== <%s> ==\n' "$@" | |
22 | } | |
23 | p() | |
24 | { | |
25 | printf '<%q>\n' "$@" | |
26 | } | |
27 | ||
a0c0a00f CR |
28 | mkdir -p $EMPTY/a/a/a |
29 | cd $EMPTY | |
ac50fbac CR |
30 | |
31 | # good | |
32 | p ** | |
33 | p **/** | |
34 | p **/**/** | |
35 | ||
36 | rm -rf a | |
a0c0a00f CR |
37 | mkdir -p $EMPTY/{a,b}/{a,b}/{a,b}/{a,b} |
38 | cd $EMPTY | |
ac50fbac CR |
39 | |
40 | # good | |
41 | s '**/a' | |
42 | p **/a | |
43 | ||
44 | # good | |
45 | s 'a/**' | |
46 | p a/** | |
47 | ||
48 | # good | |
49 | s '**' | |
50 | p ** | |
51 | ||
52 | # good | |
53 | s '**/**' | |
54 | p **/** | |
55 | ||
56 | # good | |
57 | s '**/**/**' | |
58 | p **/**/** | |
59 | ||
60 | # good | |
61 | s '**/**/**/**/**' | |
62 | p **/**/**/**/** | |
63 | ||
64 | # good | |
65 | s '**/**/a' | |
66 | p **/**/a | |
67 | ||
68 | # good | |
69 | s 'a/**/**' | |
70 | p a/**/** | |
71 | ||
72 | # good | |
73 | s 'a/**/**/**' | |
74 | p a/**/**/** | |
75 | ||
76 | # good | |
77 | s 'a/**/**/**/**' | |
78 | p a/**/**/**/** | |
79 | ||
80 | # same as ksh93 | |
81 | s '**/a/**' | |
82 | p **/a/** | |
83 | ||
84 | # same as ksh93 | |
85 | s '**/a/**/**' | |
86 | p **/a/**/** | |
87 | ||
88 | # same as ksh93 | |
89 | s '**/a/**/**/**' | |
90 | p **/a/**/**/** | |
91 | ||
92 | # good | |
93 | s '**/**/a/**' | |
94 | p **/**/a/** | |
95 | ||
a0c0a00f CR |
96 | cd "$olddir" |
97 | rm -rf $EMPTY |