]>
Commit | Line | Data |
---|---|---|
74091dd4 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 | # | |
14 | ||
15 | # test $'...' and $"..." strings in here documents (problem through bash-5.1) | |
16 | ||
17 | pat=$'no\t' | |
18 | x=$'no\tOK' | |
19 | y=notOK | |
20 | ||
21 | cat <<EOF | |
22 | 1: ${x#$'no\t'} | |
23 | 2: O${x#$'no\t'O} | |
24 | 3: ${x#n$'o\t'} | |
25 | 4: ${x#'no '} | |
26 | 5: ${x#$pat} | |
27 | 6: ${y#$'not'} | |
28 | 7: ${y#'not'} | |
29 | EOF | |
30 | ||
31 | cat <<EOF | |
32 | 1: ${x#$"no "} | |
33 | 2: ${x#n$"o "} | |
34 | 3: O${x#n$"o "O} | |
35 | 4: ${x#"no "} | |
36 | 5: ${y#$"not"} | |
37 | 5: ${y#"not"} | |
38 | EOF | |
39 | ||
40 | # we don't perform dollar-quote expansion if the here-doc delimiter is quoted | |
41 | ||
42 | cat <<\EOF | |
43 | 1: ${x#$'no\t'} | |
44 | 2: O${x#$'no\t'O} | |
45 | 3: ${x#n$'o\t'} | |
46 | 4: ${x#'no '} | |
47 | 5: ${x#$pat} | |
48 | 6: ${y#$'not'} | |
49 | 7: ${y#'not'} | |
50 | EOF |