]> git.saurik.com Git - apple/shell_cmds.git/blame - sh/tests/parser/heredoc4.0
shell_cmds-198.tar.gz
[apple/shell_cmds.git] / sh / tests / parser / heredoc4.0
CommitLineData
71aad674
A
1# $FreeBSD$
2
3failures=0
4
5check() {
6 if ! eval "[ $* ]"; then
7 echo "Failed: $*"
8 : $((failures += 1))
9 fi
10}
11
12f() {
13 cat <<EOF && echo `echo bar`
14foo
15EOF
16}
17check '"`f`" = "foo
18bar"'
19
20f() {
21 cat <<EOF && echo $(echo bar)
22foo
23EOF
24}
25check '"$(f)" = "foo
26bar"'
27
28f() {
29 echo `echo bar` && cat <<EOF
30foo
31EOF
32}
33check '"`f`" = "bar
34foo"'
35
36f() {
37 echo $(echo bar) && cat <<EOF
38foo
39EOF
40}
41check '"$(f)" = "bar
42foo"'
43
44exit $((failures != 0))