Re: Bug or feature? No EOF on /proc/xxx/fd/x

Zoltan Hidvegi (hzoli@cs.elte.hu)
Thu, 15 Feb 1996 00:38:28 +0100 (MET)


Snow Cat (snowcat@math.csufresno.edu) wrote:
> Dale Scheetz once wrote:
> >
> > On Tue, 13 Feb 1996, Austin Donnelly wrote:
> >
> > <stuff deleted>
> > >
> > > As you say, an even easier was to see the bug in action is:
> > >
> > > $ cat <(date)
> > >
> > > which should print the current date, but doesn't in newer
> > > kernels.
> >
> > I'm running a 1.3.57 kernel and this command does print the date.
> > However, the prompt fails to return untill a ^C, so it isn't quite right
> > either.
> >
>
> I wonder if it's a problem with bash. zsh still prints date and exits.

Neither zsh nor bash use /proc/fd or /dev/fd in process substitution. Both
create a temporary named pipe in /tmp for that pupose. To test this /proc
behaviour correctly try

date | cat /proc/self/fd/0

In 1.2.13 the prompt comes back after the date is printed. With 1.3.62 cat
does not get any EOF.

Both bash and zsh correctly returns the prompt after the date if you try
cat <(date) so pipes do not have this problem.

Cheers,

Zoltan