1 # $FreeBSD: head/bin/sh/tests/parser/heredoc10.0 221887 2011-05-14 14:19:30Z jilles $
3 # It may be argued that
7 # is a valid complete command that sets x to foo, because
11 # is a valid script even without the final newline.
12 # However, if the here-document is not within a new-style command substitution
13 # or there are other constructs nested inside the command substitution that
14 # need terminators, the delimiter at the start of a line followed by a close
15 # parenthesis is clearly a literal part of the here-document.
17 # This file contains tests that may not work with simplistic $(...) parsers.
18 # The open parentheses in comments help mksh, but not zsh.
23 if ! eval "[ $* ]"; then
29 check '"$(cat <<EOF # (
34 check '"$({ cat <<EOF # (
39 check '"$(if :; then cat <<EOF # (
44 check '"$( (cat <<EOF # (
49 exit $((failures != 0))