Dash Archive mirror
 help / color / mirror / Atom feed
From: наб <nabijaczleweli@nabijaczleweli.xyz>
To: Herbert Xu <herbert@gondor.apana.org.au>
Cc: Harald van Dijk <harald@gigawatt.nl>, dash@vger.kernel.org
Subject: Re: [Debian#1037195] dash: $(here-doc in <<substitution) is always empty, must consume subsequent lines per POSIX?
Date: Thu, 8 Jun 2023 22:31:23 +0200	[thread overview]
Message-ID: <v4446mlkbaddnqggbfvh6xvghckidbc5o5swi6awsimxr3afof@ctc7n34dwh3e> (raw)
In-Reply-To: <ZIGnOzJfPR0+0PNx@gondor.apana.org.au>

[-- Attachment #1: Type: text/plain, Size: 966 bytes --]

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 #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

      reply	other threads:[~2023-06-08 20:31 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-07 13:26 [Debian#1037195] dash: $(here-doc in <<substitution) is always empty, must consume subsequent lines per POSIX? наб
2023-06-07 14:13 ` Harald van Dijk
2023-06-08  9:06 ` Herbert Xu
2023-06-08  9:19   ` Harald van Dijk
2023-06-08 10:02     ` Harald van Dijk
2023-06-08 10:02     ` Herbert Xu
2023-06-08 20:31       ` наб [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=v4446mlkbaddnqggbfvh6xvghckidbc5o5swi6awsimxr3afof@ctc7n34dwh3e \
    --to=nabijaczleweli@nabijaczleweli.xyz \
    --cc=dash@vger.kernel.org \
    --cc=harald@gigawatt.nl \
    --cc=herbert@gondor.apana.org.au \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).