Need help with redirecting STDERR. Please 
Author Message
 Need help with redirecting STDERR. Please

Don Caprio <caprio> writes
I am tring to pipe the output from the Rand MH system to a file using a pipe.

The problem is that the mhn program writes to both STDOUT and STDERR.

How in the world do I pipe both STDOUT and STDERR to the same file handle?

  open(PROC,"/usr/local/bin/mhn file |")  || die ...

  This works fine for STDOUT but STDERR still goes to the console.

Thanks in Advance

--
Don Caprio
DC MicroSystems

http://www.*-*-*.com/

--
Don, I believe that it follows regular "csh" syntax; so try this:

  open(PROC,"/usr/local/bin/mhn file |&")  || die ...

                                      ^-- insert ampersand

=========================================================================
C. David Boshears               |       My opinions are mine, and

Swiss Bank Corporation          |        *You can't have them!*



Wed, 15 Apr 1998 03:00:00 GMT  
 Need help with redirecting STDERR. Please
 [courtesy cc of this posting sent to cited author via email]

In comp.lang.perl.misc,
    Don Caprio <caprio> writes:
:I am tring to pipe the output from the Rand MH system to a file using a pipe.
:
:The problem is that the mhn program writes to both STDOUT and STDERR.
:
:How in the world do I pipe both STDOUT and STDERR to the same file handle?
:
:  open(PROC,"/usr/local/bin/mhn file |")  || die ...
:
:  This works fine for STDOUT but STDERR still goes to the console.

Have you contemplated FAQ 5.15, "How can I capture STDERR from an
external command?" yet?  It probably would help you.  That question is at
http://perl.com/perl/faq/Q5.15.html from your web browser.

--tom

--

    echo "I can't find the O_* constant definitions!  You got problems."
            --The Configure script from the perl distribution



Wed, 15 Apr 1998 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. need to redirect STDOUT and STDERR

2. HELP - with redirect of STDERR and STDOUT

3. HELP - with redirect of STDERR and STDOUT

4. Help redirect STDOUT, STDERR under NT !!!

5. redirect link help please..

6. system() return value affected by stderr redirect?

7. Tie::STDERR to redirect errors (RFC)

8. CORECTION: redirecting STDERR

9. Redirect And filter STDERR?

10. How to redirect STDERR when not on a TTY

11. warn and redirected STDERR

12. how do I redirect STDERR?

 

 
Powered by phpBB® Forum Software