]> git.ipfire.org Git - thirdparty/bash.git/blame - tests/heredoc6.sub
bash-5.2 distribution sources and documentation
[thirdparty/bash.git] / tests / heredoc6.sub
CommitLineData
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
17pat=$'no\t'
18x=$'no\tOK'
19y=notOK
20
21cat <<EOF
221: ${x#$'no\t'}
232: O${x#$'no\t'O}
243: ${x#n$'o\t'}
254: ${x#'no '}
265: ${x#$pat}
276: ${y#$'not'}
287: ${y#'not'}
29EOF
30
31cat <<EOF
321: ${x#$"no "}
332: ${x#n$"o "}
343: O${x#n$"o "O}
354: ${x#"no "}
365: ${y#$"not"}
375: ${y#"not"}
38EOF
39
40# we don't perform dollar-quote expansion if the here-doc delimiter is quoted
41
42cat <<\EOF
431: ${x#$'no\t'}
442: O${x#$'no\t'O}
453: ${x#n$'o\t'}
464: ${x#'no '}
475: ${x#$pat}
486: ${y#$'not'}
497: ${y#'not'}
50EOF