in reply to RE: How to split output using Expect.pm
in thread How to split output using Expect.pm
However your basic idea is good, only the implementation has problems. Indeed you could pipe STDOUT and STDERR of the program through filters that would tag the output. There probably is a nice way to do it, but one silly and inefficient way is to launch a wrapper program that opens pipes to two filter programs that will tag their output, then launches your desired command using IPC::Open3, connecting it's STDIN to yours, and its STDOUT and STDERR to the two filters.
The wrapper can, incidentally, use the wait call to reap the children and also get the exit code of the command you are trying to wrap.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
RE: RE (tilly) 2: How to split output using Expect.pm
by Adam (Vicar) on Aug 17, 2000 at 03:35 UTC |