Re: [Debian#1037195] dash: $(here-doc in <<substitution) is always empty, must consume subsequent lines per POSIX?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Jun 08, 2023 at 06:02:35PM +0800, Herbert Xu wrote:
> On Thu, Jun 08, 2023 at 10:19:24AM +0100, Harald van Dijk wrote:
> : For "$(" and '`' only, if instances of io_here tokens are found nested
> : within the substitution, they shall be parsed according to the rules
> : of [xref to 2.7.4]; if the terminating ')' or '`' of the substitution
> : occurs before the NEWLINE token marking the start of the here-document,
> : the behavior is unspecified.

I hand't looked if there were any explicit provisions for $( of
this sort, so I took the original segments I quoted to to include, in
  echo "$(head -n1 <<EOF)"
  2
  3
  EOF
that the first newline is the one that's at the end of line 1,
since it's next in the "input", and it wasn't clear to me whether
input is supposed to be the command in $(command), like dash does,
or the raw input, like bash does
(which did surprise me at first, since it violated $( nesting).

Thanks for clearing this up :)

Best,

Attachment: signature.asc
Description: PGP signature


[Index of Archives]     [LARTC]     [Bugtraq]     [Yosemite Forum]     [Photo]

  Powered by Linux