[vox-tech] quick, stupid bash question

Peter Jay Salzman vox-tech@lists.lugod.org
Wed, 29 May 2002 14:40:25 -0700


begin msimons@moria.simons-clan.com <msimons@moria.simons-clan.com> 
> On Wed, May 29, 2002 at 03:18:08PM -0400, msimons@moria.simons-clan.com wrote:
> > On Wed, May 29, 2002 at 11:29:29AM -0700, Peter Jay Salzman wrote:
> > > begin nbs <nbs@sonic.net> 
> > > >      strace lsof 2>&1 1> /dev/null | grep
> > >  
> > > ok, haven't tried this, but this looks to me like:
> > > 
> > > put stderr into stdout
> > > redirect stdout (and therefore stderr) into /dev/null
> > > pipe stdout (which should be null) to grep.
> > 
> >   The order of operation of file operators is right to left.  
> 
> On Wed, May 29, 2002 at 12:32:45PM -0700, Shawn P. Neugebauer wrote:
> > The order of redirects is left to right.
> 
>   Based on Shawn's comment I've done some tests and operation is very
> much left to right like he says.  Now I have a better understanding of 
> how dup2 works... but I hope I really don't need to use this anytime 
> soon.
 
(snip)

this was a very valuable thread -- i'm very glad i asked the question
and even more glad people riffed with the theme.

but the actual answer is completely unacceptable.

i can't believe that this is so complicated under bash!  i really wish
that the bash developers would so something like:

   strace foo 2| grep bar

i see this as a bash deficiency.   :(


but it _was_ a great lesson!

pete