]> CyberLeo.Net >> Repos - FreeBSD/releng/9.2.git/blob - tools/regression/bin/sh/parser/heredoc4.0
- Copy stable/9 to releng/9.2 as part of the 9.2-RELEASE cycle.
[FreeBSD/releng/9.2.git] / tools / regression / bin / sh / parser / heredoc4.0
1 # $FreeBSD$
2
3 failures=0
4
5 check() {
6         if ! eval "[ $* ]"; then
7                 echo "Failed: $*"
8                 : $((failures += 1))
9         fi
10 }
11
12 f() {
13         cat <<EOF && echo `echo bar`
14 foo
15 EOF
16 }
17 check '"`f`" = "foo
18 bar"'
19
20 f() {
21         cat <<EOF && echo $(echo bar)
22 foo
23 EOF
24 }
25 check '"$(f)" = "foo
26 bar"'
27
28 f() {
29         echo `echo bar` && cat <<EOF
30 foo
31 EOF
32 }
33 check '"`f`" = "bar
34 foo"'
35
36 f() {
37         echo $(echo bar) && cat <<EOF
38 foo
39 EOF
40 }
41 check '"$(f)" = "bar
42 foo"'
43
44 exit $((failures != 0))