help-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Help-bash] stdout and stderr to two different process substitutions


From: Greg Wooledge
Subject: Re: [Help-bash] stdout and stderr to two different process substitutions
Date: Wed, 25 Jan 2012 10:25:38 -0500
User-agent: Mutt/1.4.2.3i

On Wed, Jan 25, 2012 at 09:21:36AM -0600, Peng Yu wrote:
> > First of all, 1>&2 literally does mean "redirect stdin to where stderr is
> > currently pointing".  That's what it's for.
> 
> You interpretation seems to be different from what is explained here.
> Do I misunderstand anything here?

Sorry, I mistyped.  I should have written "redirect stdout to where stderr
is currently pointing".

> http://tldp.org/HOWTO/Bash-Prog-Intro-HOWTO-3.html
> 
> "3.4 Sample: stdout 2 stderr
> 
> This will cause the stderr ouput of a program to be written to the
> same filedescriptor than stdout.
> 
>             grep da * 1>&2
> "

THAT explanation, however, is quite wrong.  1>&2 is a redirection of
stdout, not of stderr.  It changes where FD 1 (stdout) goes.  It does
not change where FD 2 (stderr) goes.

There are numerous errors in the "ABS" guide, so you must be prepared to
unlearn anything you learn from it.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]