]> git.ipfire.org Git - thirdparty/bash.git/blame - tests/glob5.sub
Bash-5.2-rc4 release
[thirdparty/bash.git] / tests / glob5.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#
4491c030
CR
14[ $UID -eq 0 ] && { echo "glob5.sub: the test suite should not be run as root" >&2 ; }
15
8868edaf
CR
16ORIGD=$PWD
17: ${TMPDIR:=/var/tmp}
18
19SD=$TMPDIR/bash-glob-$$
20[ -d $SD ] || mkdir $SD
21builtin cd $SD || { echo "glob5.sub: cannot change directory to $SD" >&2 ; exit 1; }
22mkdir tmp
23
24D=./tmp/a
25D1='./t\mp/a'
26
27mkdir -m700 ./tmp/a ./tmp/a/b
28touch ./tmp/a/b/c
29
30echo ./tmp/a/b/* "./tmp/a/"b/* "./tmp/a/b"/*
31
32chmod -r ./tmp/a
33echo ./tmp/a/b/* "./tmp/a/"b/* "./tmp/a/b"/*
34echo "./tmp/a/b"/*
35
36bs=\\
37echo ./tmp${bs}/a/b/*
38echo ./tmp${bs}/a/b/c
39echo ./tm[p]${bs}/a/b/c
40echo ./t${bs}mp/a/b/*
41
42recho "./tmp/a"/*
43recho "$D"/*
44recho "$D"/b/*
45
46recho $D/*
47recho $D/b/*
48recho $D1/*
49recho $D1/b/*
50recho $D/
51recho $D/b/
52recho $D1/
53recho $D1/b/
54
55recho ./t\mp/a/*
56recho ./t\mp/a/b/*
57
58recho ./tmp/a*
59recho ./tmp/a/b*
60recho ./t\mp/a*
61recho ./t\mp/a/b*
62
63recho ./t\mp/
64
65chmod +r ./tmp/a
66rm -rf ./tmp/a
67
68a='$foo'
69b='$bar'
70a=$(echo "$a" | sed 's/\$/\\$/g')
71
72recho $a "$a"
73recho 'mixed'$a/
74
75unset a b
76
77cd $ORIGD
78rm -rf $SD