preventing FIFO from EOF

rihad rihad at mail.ru
Fri Dec 12 06:12:47 PST 2008


Christoph Mallon wrote:
> rihad schrieb:

> Something as simple as this:
> $ sh < /dev/null > /var/tmp/kick 2>/dev/null
> seems to block indefinitely, but exits as soon as I run
> $ buffer -i /var/tmp/foo
> (and buffer exits too) 

Strangely enough, something as stupid as this does the trick:
sh < /dev/stdout > /var/tmp/kick 2>/dev/null

i.e. reading from stdout blocks. Now sh keeps buffer block on 
/var/tmp/kick and never exit ;) I'm not sure what this does or why and 
how it works Unix-wise.


More information about the freebsd-hackers mailing list