(03/10/2011 11:53 AM), Micah Cowan wrote:
> (03/10/2011 11:42 AM), Philip Prindeville wrote:
>> My request is simple.  Using termcap/ncurses info (which you need anyway
>> for the readline stuff), it would be nice to have the option of running
>> commands in a pseudo-tty and then bracketing the output from STDERR with
>> <highlight on>...<highlight off>.

<snip>

> It wouldn't be difficult to write as a separate program, which is really
> how this should be handled. You could redirect a pipeline's STDOUT and
> STDERR to individual named pipes (FIFOs), and have a separate program
> read from both pipes, inserting highlights around any data it copies
> from the STDERR pipe.

The idea intrigued me somewhat, so I hacked up a Perl script that
attempts to do this (no guarantees of error-free code).

Find it at http://micah.cowan.name/hg/demarcate/raw-file/tip/demarcate

Set it to executable, and then try it out like:

mkfifo out
mkfifo err
./demarcate
<some program>  >out 2>err

-- 
HTH,
Micah J. Cowan
http://micah.cowan.name/

Reply via email to