Subject: Re: cat(1) question: multiple "-"s
To: Chavdar Ivanov <ci4ic4@gmail.com>
From: Hubert Feyrer <hubert@feyrer.de>
List: netbsd-users
Date: 04/18/2006 17:21:20
On Tue, 18 Apr 2006, Chavdar Ivanov wrote:
> If the user tries to open a file descriptor for reading more than once,
>       the  shell opens the file descriptor as a pipe to a process that copies
>       all the specified inputs to its output in the order specified,  similar
>       to cat, provided the MULTIOS option is set.  Thus

How does zsh know that a file descriptor in its child process is opened?

I imagine something like

 	while(read from stdin) { process() }
 	close(stdin)
 	open(stdin from XXX)
 	while(read from stdin) { process() }
 	...

I wonder how zsh passes to cat what XXX is.


  - Hubert