Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Unexpected stdin-behavior

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


"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."

``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