Date: Fri, 20 May 2011 16:03:36 +0000 (UTC) From: Jilles Tjoelker <jilles@FreeBSD.org> To: cvs-src-old@freebsd.org Subject: cvs commit: src/bin/sh parser.c src/tools/regression/bin/sh/parser heredoc11.0 Message-ID: <201105201606.p4KG6NCZ007724@repoman.freebsd.org>
index | next in thread | raw e-mail
jilles 2011-05-20 16:03:36 UTC
FreeBSD src repository
Modified files:
bin/sh parser.c
Added files:
tools/regression/bin/sh/parser heredoc11.0
Log:
SVN rev 222134 on 2011-05-20 16:03:36Z by jilles
sh: Allow terminating a heredoc with a terminator at EOF without a newline.
This is sometimes used with eval or old-style command substitution, and most
shells other than ash derivatives allow it.
It can also be used with scripts that violate POSIX's requirement on the
application that they end in a newline (scripts must be text files except
that line length is unlimited).
Example:
v=`cat <<EOF
foo
EOF`
echo $v
This commit does not add support for the similar construct with new-style
command substitution, like
v=$(cat <<EOF
foo
EOF)
This continues to require a newline after the terminator.
Revision Changes Path
1.111 +5 -3 src/bin/sh/parser.c
1.1 +26 -0 src/tools/regression/bin/sh/parser/heredoc11.0 (new)
help
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201105201606.p4KG6NCZ007724>
