]> git.ipfire.org Git - thirdparty/bash.git/blob - tests/extglob1.sub
Bash-5.2-rc4 release
[thirdparty/bash.git] / tests / extglob1.sub
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 #
14 MYDIR=$PWD
15
16 : ${TMPDIR:=/tmp}
17 GDIR=$TMPDIR/gtest-$$
18
19 shopt -s extglob
20
21 mkdir $GDIR || exit 1
22 cd $GDIR || exit 1
23
24 touch a.c
25
26 echo +([[:alpha:].])
27 echo +([[:alpha:].])+([[:alpha:].])
28 echo *([[:alpha:].])
29 echo *([[:alpha:].])*([[:alpha:].])
30
31 echo ?([[:alpha:].])?([[:alpha:].])?([[:alpha:].])
32 echo @([[:alpha:].])@([[:alpha:].])@([[:alpha:].])
33
34 case . in
35 !([[:alpha:].]) ) echo bad 1;;
36 *) echo ok 1;;
37 esac
38
39 case . in
40 ?([[:alpha:].]) ) echo ok 2;;
41 *) echo bad 2;;
42 esac
43
44 case . in
45 @([[:alpha:].]) ) echo ok 3;;
46 *) echo bad 3;;
47 esac
48
49 cd "$MYDIR"
50 rm -rf $GDIR