]> git.ipfire.org Git - thirdparty/bash.git/blame - tests/globstar2.sub
Bash-5.2 patch 26: fix typo when specifying readline's custom color prefix
[thirdparty/bash.git] / tests / globstar2.sub
CommitLineData
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 14olddir=$PWD
d233b485
CR
15: ${TMPDIR:=/var/tmp}
16EMPTY=$TMPDIR/empty
a0c0a00f 17
ac50fbac
CR
18shopt -s globstar
19s()
20{
21 printf '== <%s> ==\n' "$@"
22}
23p()
24{
25 printf '<%q>\n' "$@"
26}
27
a0c0a00f
CR
28mkdir -p $EMPTY/a/a/a
29cd $EMPTY
ac50fbac
CR
30
31# good
32p **
33p **/**
34p **/**/**
35
36rm -rf a
a0c0a00f
CR
37mkdir -p $EMPTY/{a,b}/{a,b}/{a,b}/{a,b}
38cd $EMPTY
ac50fbac
CR
39
40# good
41s '**/a'
42p **/a
43
44# good
45s 'a/**'
46p a/**
47
48# good
49s '**'
50p **
51
52# good
53s '**/**'
54p **/**
55
56# good
57s '**/**/**'
58p **/**/**
59
60# good
61s '**/**/**/**/**'
62p **/**/**/**/**
63
64# good
65s '**/**/a'
66p **/**/a
67
68# good
69s 'a/**/**'
70p a/**/**
71
72# good
73s 'a/**/**/**'
74p a/**/**/**
75
76# good
77s 'a/**/**/**/**'
78p a/**/**/**/**
79
80# same as ksh93
81s '**/a/**'
82p **/a/**
83
84# same as ksh93
85s '**/a/**/**'
86p **/a/**/**
87
88# same as ksh93
89s '**/a/**/**/**'
90p **/a/**/**/**
91
92# good
93s '**/**/a/**'
94p **/**/a/**
95
a0c0a00f
CR
96cd "$olddir"
97rm -rf $EMPTY