]> git.ipfire.org Git - thirdparty/bash.git/blob - tests/glob2.sub
bash-5.1 distribution sources and documentation
[thirdparty/bash.git] / tests / glob2.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 . ./test-glue-functions
15
16 var='ab\'
17
18 case $var in
19 ab\\) echo ok 1;;
20 *) echo bad 1;;
21 esac
22
23 case $var in
24 $var) echo ok 2;;
25 *) echo bad 2;;
26 esac
27
28 case $var in
29 'ab\') echo ok 3;;
30 *) echo bad 3;;
31 esac
32
33 [[ $var = $var ]] && echo ok 4
34 [[ $var = $'ab\134' ]] && echo ok 5
35
36 LC_ALL=zh_HK.big5hkscs
37
38 read a b c <<< $'\u3b1 b c\n'
39 echo $b
40 unset a b c
41
42 export alpha=$'\u3b1'
43
44 printf -v v 'A%sB' "$alpha"
45 recho "$v"
46 IFS=$alpha read a b c <<<"$v"
47 recho "$a"
48 recho "$b"
49 unset a b v
50
51 recho "a${alpha}b"
52 printf "%s" "a${alpha}b" | LC_ALL=C od -b | _intl_normalize_spaces
53
54 a=$'\u3b1'
55 [[ $a = $a ]] && echo ok 6
56
57 LC_ALL=zh_HK.big5hkscs ${THIS_SH} -c $'[[ \u3b1 = \u3b1 ]]' && echo ok 7