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: Peng Yu
Subject: Re: [Help-bash] stdout and stderr to two different process substitutions
Date: Wed, 25 Jan 2012 09:31:06 -0600

On Wed, Jan 25, 2012 at 9:25 AM, Greg Wooledge <address@hidden> wrote:
> 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.

Good catch. I missed it. I was primarily focused on the section title
(which should be correct?).



-- 
Regards,
Peng



reply via email to

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