Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Unexpected stdin-behavior
- X-seq: zsh-workers 49517
- From: Tycho Kirchner <tychokirchner@xxxxxxx>
- To: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- Cc: Zsh hackers list <zsh-workers@xxxxxxx>
- Subject: Re: Unexpected stdin-behavior
- Date: Fri, 22 Oct 2021 16:24:00 +0200
- Archived-at: <https://zsh.org/workers/49517>
- In-reply-to: <CAH+w=7Y_3DBPO=AfYBnKmFUN3cdffGB=65z4BepmtQBJgBGd9w@mail.gmail.com>
- List-id: <zsh-workers.zsh.org>
- References: <2abd99f9-c1c0-1385-f8b4-be9b8f14c4d9@mail.de> <CAH+w=7Ype8LCU4nywbNwjbTQ4G6sfa3yihNfZUtsnLBi7CJ0kA@mail.gmail.com> <13d30855-d91c-7def-6834-f0ec24cfd598@mail.de> <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@xxxxxxxx http://tiswww.cwru.edu/~chet/
Messages sorted by:
Reverse Date,
Date,
Thread,
Author