Re: Need blocking /dev/null

Ville Herva
2001-11-02T20:32:51Z

On Fri, Nov 02, 2001 at 04:04:13PM -0400, you [John Adams] claimed:
> > >
> > > $ exec 3>&1; find / -name "wanted-but-lost-download" 2>&1 1>&3 3>&- |
> > > eat
> > >
> > > [stolen from "Csh Programming Considered Harmful" by Tom Christiansen]
> > >
> > > Horrible, but does work. ;)
>
> You really do take the hard way. Try this to pipe just stderr:
> command_that_outputs_on_1_and_2 2>/dev/stdout 1>/dev/null | eat

Hmm.

The initial question was how to do

find / -name foo 2> /dev/null

or similar if /dev/null is not present. (Eat is a place holder for a
imaginary progrom acting as /dev/null replacement).

I guess

find / -name foo 2>/dev/stdout 1>/dev/stderr | eat

would (kinda) work, but it fails if you want to do

find / -name foo 2> /dev/null | less

Can be done with named pipes, though.

-- v --

v@iki.fi