heredoc5.0 revision 208655
138032Speter# $FreeBSD: head/tools/regression/bin/sh/parser/heredoc5.0 208655 2010-05-30 14:11:27Z jilles $ 238032Speter 3261363Sgshapirofailures=0 464562Sgshapiro 538032Spetercheck() { 638032Speter if ! eval "[ $* ]"; then 738032Speter echo "Failed: $*" 838032Speter : $((failures += 1)) 938032Speter fi 1038032Speter} 1138032Speter 1238032Speterf() { 1338032Speter cat <<EOF && echo `cat <<EOF 1438032Speterbar 15261363SgshapiroEOF 1638032Speter` 1738032Speterfoo 1838032SpeterEOF 1938032Speter} 20check '"`f`" = "foo 21bar"' 22 23f() { 24 cat <<EOF && echo $(cat <<EOF 25bar 26EOF 27) 28foo 29EOF 30} 31check '"$(f)" = "foo 32bar"' 33 34f() { 35 echo `cat <<EOF 36bar 37EOF 38` && cat <<EOF 39foo 40EOF 41} 42check '"`f`" = "bar 43foo"' 44 45f() { 46 echo $(cat <<EOF 47bar 48EOF 49) && cat <<EOF 50foo 51EOF 52} 53check '"$(f)" = "bar 54foo"' 55 56exit $((failures != 0)) 57