From: Tycho Kirchner <tychokirchner@mail.de>
To: Bart Schaefer <schaefer@brasslantern.com>
Cc: Zsh hackers list <zsh-workers@zsh.org>
Subject: Re: Unexpected stdin-behavior
Date: Fri, 22 Oct 2021 16:24:00 +0200 [thread overview]
Message-ID: <8b398ade-e4d2-f795-ad4f-b72b21e7fe75@mail.de> (raw)
In-Reply-To: <CAH+w=7Y_3DBPO=AfYBnKmFUN3cdffGB=65z4BepmtQBJgBGd9w@mail.gmail.com>
I also sent an email to the dash-developers regarding the same issue,
you may be interested in Chet's response:
On 10/22/21 7:11 AM, Tycho Kirchner wrote:
> Dear DASH developers,
> I think stdin should be consumed line by line in order to make
passing to
> other commands possible. Please consider the following difference
between
> the stdin "consumption" between bash and dash
If you're curious, POSIX specifies the bash behavior. From
https://pubs.opengroup.org/onlinepubs/9699919799/utilities/sh.html#tag_20_117
"When the shell is using standard input and it invokes a command that also
uses standard input, the shell shall ensure that the standard input file
pointer points directly after the command it has read when the command
begins execution. It shall not read ahead in such a manner that any
characters intended to be read by the invoked command are consumed by the
shell (whether interpreted by the shell or not) or that characters that are
not read by the invoked command are not seen by the shell."
Chet
--
``The lyf so short, the craft so long to lerne.'' - Chaucer
``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU chet@case.edu http://tiswww.cwru.edu/~chet/
prev parent reply other threads:[~2021-10-22 14:25 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-10-21 12:40 Tycho Kirchner
2021-10-21 15:55 ` Bart Schaefer
[not found] ` <13d30855-d91c-7def-6834-f0ec24cfd598@mail.de>
2021-10-21 19:14 ` Bart Schaefer
2021-10-22 10:28 ` Tycho Kirchner
2021-10-22 10:58 ` Peter Stephenson
2021-10-22 14:24 ` Tycho Kirchner [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=8b398ade-e4d2-f795-ad4f-b72b21e7fe75@mail.de \
--to=tychokirchner@mail.de \
--cc=schaefer@brasslantern.com \
--cc=zsh-workers@zsh.org \
/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.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
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 NNTP newsgroup(s).