pipe equivalent to /dev/null ???

Robert E. Stampfli res at cbnews.att.com
Sun Sep 16 13:10:35 AEST 1990


> >>Is there an equivalent 'pipe' like entity to /dev/null ?
> >
> >I've seen responses of
> >	anycommand | true
> 
> I've been following this thread for some time, and I have
> to say that neither '... | true' nor '... | :' will do the trick.
> 'true' and ':' don't read their stdin, thus the process feeding them
> would block and never run.

Several people have commented to this effect, but it is normally not true
that this sequence would block, at least not for long.  Rather, "true" would
execute and exit, and "anycommand" would then receive the broken pipe
signal.  Usually this would cause it to terminate.  The net result, however,
is that, although the sequence might appear to work, "anycommand" would
terminate abnormally and could not be guaranteed to do any side effects
which it might be expected to have done, say, after processing all of
its data.
-- 
Rob Stampfli	/ att.com!stampfli (uucp at work) / kd8wk at w8cqk (packet radio)
614-864-9377	/ osu-cis.cis.ohio-state.edu!kd8wk!res (uucp at home)



More information about the Comp.unix.shell mailing list