How to read STDERR messages from a third party program?

A

Arne Goetje

Hi,

I want my perl script to start a third party program (daemon) in the
background and capture the messages it sends out onto STDERR
occasionally.
These messages should be processed by my perl script.

Any idea how to do this?

Please CC to me. Thanx.
 
J

Josef Möllers

Arne said:
Hi,

I want my perl script to start a third party program (daemon) in the
background and capture the messages it sends out onto STDERR
occasionally.
These messages should be processed by my perl script.

Any idea how to do this?

If your daemon doen't do any output to stdout, you could just redirect
stderr to stdout:
open(DAEMON, "daemon 2>&1 |");
 
F

fifo

At said:
If your daemon doen't do any output to stdout, you could just redirect
stderr to stdout:
open(DAEMON, "daemon 2>&1 |");

Or if it does write to stdout, you can suppress this
with "daemon 2>&1 1>/dev/null |".
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,013
Latest member
KatriceSwa

Latest Threads

Top