Subject: Re: cat(1) question: multiple "-"s
To: Johnny Billquist <>
From: Johnny Billquist <>
List: netbsd-users
Date: 04/18/2006 19:31:13
Doh! And as others have already noted later, zsh don't do anything like 
this. It just concatenates the files, and feed the result to stdin.

Hmm, I wonder if it wouldn't be possible to simulate eofs on a stream, 
but then present more data. I believe that is what really would be 
Thinking of it, I don't think that it's possible. The only stream that I 
know, that can do this, are ttys. Anyone?


Johnny Billquist wrote:
> Isn't that obvious?
> When the first redirected stdin gives eof, it switches to the next one.
> I've never seriously played with zsh, but I've always been someone 
> intrigued by it. I wonder if any other shell have that one.
>     Johnny
> Hubert Feyrer wrote:
>> On Tue, 18 Apr 2006, Chavdar Ivanov wrote:
>>> root@loan8>   cat - - - < /tmp/1 < /tmp/2 </tmp/3
>>>                                             /tmp
>>> 11111
>>> 22222
>>> 33333
>> Wow. How does that work?
>> I'm familiar with the concepts of stdio, stdin and eof, but
>> how does cat/zsh know when to attach the next file to the stdin file 
>> descriptor?
>>  - Hubert

Johnny Billquist                  || "I'm on a bus
                                   ||  on a psychedelic trip
email:           ||  Reading murder books
pdp is alive!                     ||  tryin' to stay hip" - B. Idol