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

Harald Koenig (koenig@tat.physik.uni-tuebingen.de)
16 Feb 96 10:31:22 MET


In <199602142338.AAA07196@bolyai.cs.elte.hu> Zoltan Hidvegi <hzoli@cs.elte.hu> writes:

> 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

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

this isn't always true for bash! it's a compile (configuration) time option
of bash. it uses /dev/fd/* if "/dev/fd" is a directory (check support/mksysdefs
for HAVE_DEV_FD).

since for "/dev/fd" is a symlink to "/proc/self/fd" and I compiled bash myself,
cat <(date) doesn't work :-(

I just rebuilt bash-1.14.6 without /dev/fd/* support and named pipes work fine now
but I get the following strange/nasty message with the builtin echo

$ echo <(date)
/tmp/sh-np-a04623
$ bash: cannot open named pipe /tmp/sh-np-a04623 for writing: No such file or directory

note that there is the normal shell prompt "$" before this message,
echo "terminated" too fast...

Harald

-- 
All SCSI disks will from now on                     ___       _____
be required to send an email notice                0--,|    /OOOOOOO\
24 hours prior to complete hardware failure!      <_/  /  /OOOOOOOOOOO\
                                                    \  \/OOOOOOOOOOOOOOO\
                                                      \ OOOOOOOOOOOOOOOOO|//
Harald Koenig,                                         \/\/\/\/\/\/\/\/\/
Inst.f.Theoret.Astrophysik                              //  /     \\  \
koenig@tat.physik.uni-tuebingen.de                     ^^^^^       ^^^^^