]> git.ipfire.org Git - thirdparty/bash.git/blame - tests/heredoc3.sub
Bash-4.3 patch 7
[thirdparty/bash.git] / tests / heredoc3.sub
CommitLineData
ac50fbac
CR
1text=$(cat <<EOF
2here is the text
3EOF)
4
5echo = $text =
6
7unbalanced=$(cat <<EOF
8this paren ) is not a problem
9EOF)
10
11echo $unbalanced
12
13balanced=$(cat <<EOF
14these balanced parens ( ) are not a problem
15EOF)
16
17echo $balanced
18
19balanced=$(cat <<EOF
20quoted balanced parens \( ) are not a problem either
21EOF)
22
23echo $balanced
24
25(cat <<EOF
26more text in a subshell
27EOF
28)
29
30(cat <<EOF; )
31some more text in a different subshell
32EOF
33echo end
34
35# semi-weird examples posted by Wayne Pollack to austin-group mailing list
36cat <<-' END'
37 hello
38 END
39
40cat <<END
41hello
42END\
43END
44END
45echo end ENDEND
46
47cat <<' END '
48hello
49 END
50echo end hello
51
52cat <<x*x & touch 'x*x'
53x star x
54x*x
55echo end 'x*x'
56rm 'x*x'
57
58cat <<END
59hello\
60END
61END
62echo end helloEND
63
64cat <<END
65hello
66\END
67END
68echo end 'hello<NL>\END'
69
70# this has to be last -- results in a syntax error
71# doesn't currently parse because EOF is not on a line by itself -- should it?
72(cat <<EOF
73still more text in a subshell
74EOF)