lkml.org 
[lkml]   [2001]   [Nov]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: Need blocking /dev/null
Doug McNaught wrote:
>
> Riley Williams <rhw@MemAlpha.cx> writes:
>
> > Are you sure?
> >
> > > find / -name "wanted-but-lost-download" | eat
> >
> > Doesn't work - you're piping the stdin there, not stderr as per my
> > example above. AFAIK, there's no way to pipe stderr without also piping
> > stdout, hence this sort of solution just doesn't work.
>
> 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]
>
> Horrible, but does work. ;)

$ find / -name "wanted-but-lost-download" 2>&1 1>&0 | eat

is simpler although dependent on stdin being a tty

--
Abramo Bagnara mailto:abramo@alsa-project.org

Opera Unica Phone: +39.546.656023
Via Emilia Interna, 140
48014 Castel Bolognese (RA) - Italy

ALSA project http://www.alsa-project.org
It sounds good!
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:12    [W:0.097 / U:0.292 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site