Re: Need blocking /dev/null

Ville Herva
2001-11-01T07:27:49Z

On Wed, Oct 31, 2001 at 07:11:47PM -0500, you [Doug McNaught] claimed:
> Riley Williams <rhw@MemAlpha.cx> writes:
>
> The Bourne shell is more perverse than you realize:
>
> $ exec 3>&1; find / -name "wanted-but-lost-download" 2>&1 1>&3 3>&- | eat
>
> [stolen from "Csh Programming Considered Harmful" by Tom Christiansen]

Wow. I actually played a minute with zsh, but didn't find a way... I was
pretty sure, though, that it was doable.

> Horrible, but does work. ;)
>
> > > zerofill | head -c 1440k > /tmp/floppy.img
> >
> > How does zerofill know when to stop writing zeros out?
>
> Easy, it gets EPIPE on the write (or gets killed by SIGPIPE if it's
> stupid).

Stupid... Or lazy ;).

> > > ssh foo@bar | block
> >
> > Which of my examples is this an equivalent to? I don't recognise it.
>
> None; he's referring to the /dev/block example that started the
> thread.

Yep.

> I'm still happy to keep /dev/null and /dev/zero. ;)

So am I. Perhaps it is better to let this thread die...

-- v --

v@iki.fi