heredoc2.0 revision 206145
1# $FreeBSD: head/tools/regression/bin/sh/parser/heredoc2.0 206145 2010-04-03 20:55:56Z jilles $ 2 3failures=0 4 5check() { 6 if ! eval "[ $* ]"; then 7 echo "Failed: $*" 8 : $((failures += 1)) 9 fi 10} 11 12s='ast*que?non' sq=\' dq=\" 13 14check '"$(cat <<EOF 15${s} 16EOF 17)" = "ast*que?non"' 18 19check '"$(cat <<EOF 20${s+"x"} 21EOF 22)" = ${dq}x${dq}' 23 24check '"$(cat <<EOF 25${s+'$sq'x'$sq'} 26EOF 27)" = ${sq}x${sq}' 28 29check '"$(cat <<EOF 30${s#ast} 31EOF 32)" = "*que?non"' 33 34check '"$(cat <<EOF 35${s##"ast"} 36EOF 37)" = "*que?non"' 38 39check '"$(cat <<EOF 40${s##'$sq'ast'$sq'} 41EOF 42)" = "*que?non"' 43 44exit $((failures != 0)) 45