in reply to backticks fail to capture stderr even with explicit redirection

Can somebody suggest why backticks aren't able to capture stderr in our environment?
That's because the shell does it that way.

Considering that it's rather easy to merge streams, and rather hard to separate merged streams, I'm rather glad that backticks don't merge STDOUT and STDERR.

  • Comment on Re: backticks fail to capture stderr even with explicit redirection

Replies are listed 'Best First'.
Re^2: backticks fail to capture stderr even with explicit redirection
by keithhanlan (Initiate) on Jul 06, 2011 at 19:29 UTC
    Perhaps I didn't phrase my question properly. I should have written Can somebody suggest why subshells launched by backticks don't let me redirect stderr?

    You'll notice that I am trying to explicitly merge stdout & stderr. The problem is that backticks ignore my explicit direction. Refer to the updated comments at the top of my original post for more information.

    Thank you,
    Keith

      You'll notice that I am trying to explicitly merge stdout & stderr. The problem is that backticks ignore my explicit direction.
      Uhm, you *are* capturing both STDOUT and STDERR. Other than that your test program is written in such a way that it neither proves, nor disproves that you are capturing both, what makes you think it doesn't?

      Hint, change your print "Captured $x" in print "Captured --->$x<---\n" and it should be obvious.