On Mon, Aug 22, 2005 at 04:28:23PM -0400, Adam Montague wrote:
[unquoted here-documents]
[...]
> $ cat<<\EOF
> > \"
> > EOF
> \"
>
> which works fine. Can anyone confirm for sure wether the configure
> script is wrong or if sh should be leaving the \" alone?
>From 1003.1, section about here-documents:
| If no characters in word are quoted, all lines of the here-document
| shall be expanded for parameter expansion, command substitution,
| and arithmetic expansion. In this case, the backslash in the input
| behaves as the backslash inside double-quotes (see Double-Quotes).
So far, the pdksh shipped with OpenBSD seems to be correct. But...
| However, the double-quote character ( ' )' shall not be treated
^^^^^^ probably a typo.
| specially within a here-document, except when the double-quote
| appears within "$()", "``", or "${}".
IMHO this doesn't apply for the previous statement about backslashes.
However it's interesting that ksh version "M 1993-12-28 p" (shipped,
e.g., with MacOS X) has different semantics (i.e., \" is kept
verbatim within an unquoted here-document). Maybe a misinterpretation
of POSIX?
Ciao,
Kili