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