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