Hi,
I've this script:
#!/bin/sh
cat <<__EOF
$(/bin/echo 'aa\\
b')
__EOF
cat <<__EOF
$(/bin/echo 'aa\
b')
__EOF
\<newline> is removed, but two backslahes aren't replaced by one, as I
expect it would happen is the backslash would be expanded.
% bash /tmp/skript
aa\\
b
aab
% dash /tmp/skript
aa\\
b
aa\
b
% zsh /tmp/skript
aa\\
b
aa\
b
And yes, the section 2.7.4 of the POSIX standard is somewhat unclear.
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). However, the
double-quote character ( ' )' shall not be treated specially within a
here-document, except when the double-quote appears within "$()", "``",
or "${}".
Bye, Jörg.