Re: Start a program and get a hold of it's STDOUT and STDIN?
- From: axel@xxxxxxxxxxxxxxxxxxxxxx
- Date: Fri, 08 Apr 2005 18:24:31 -0500
Snail <snail@xxxxxxxxxxxxx> wrote:
> Hello. I am trying to write a logging program to wrap around a server
> program that we need that doesn't have logging capabilities of it's own.
> Normally, one would just redirect it on the command line:
> ./server 2>&1 logfile.log
> But this doesn't have any dating what so ever and it can get hard to
> read as it grows.
> I've been search all over (perldoc, google, etc) and all I could find
> was examples of getting STDIN or STDOUT (using pipes) but not both at
> the same time. Further mode, I need this to be in real time (when the
> server spits out something to STDOUT/ERR I want my program to
> immediately get this, and then process it (add a line to the log file,
> perform some processing if a certain event occurs, such has a new
> connection, etc.)
% server 2>&1 | wrapper_prog
Axel
.
- References:
- Prev by Date: Re: Start a program and get a hold of it's STDOUT and STDIN?
- Next by Date: Re: Start a program and get a hold of it's STDOUT and STDIN?
- Previous by thread: Re: Start a program and get a hold of it's STDOUT and STDIN?
- Next by thread: Re: Start a program and get a hold of it's STDOUT and STDIN?
- Index(es):
Relevant Pages
|