From: John DuBois on
In article <f54d87be-3a3f-4a2a-98c3-a6059d7a1abf(a)>,
pg(a) <phil.ganchev(a)> wrote:
>On May 14, 3:00�pm, spce...(a) (John DuBois) wrote:
>> In article <9ca3389f-2b32-4c20-85cf-74d6ab683...(a)>,
>> p...(a) <phil.ganc...(a)> wrote:
>> >Is it possible to make any of those a different color than the others?
>> >In any shell?
>> This may be useful:
>Thanks for the reply. The armory server seems to be down, so I can't
>see the program you refer to.

Second drive failure in a year... back up now.

>Also, I guess this means you would have
>to embed every command in this outer command, right?

Either that, or invoke the entire shell program with it.
If you want to set it up from within a shell program, here's how to do it in
ksh & shells with similar capabilities. Remove the -u from the sed commands if
you aren't use GNU sed. Note that even with -u, output to different fds isn't
guaranteed to be delivered in the order that it was generated.

# Setup: filter output through processes that prefix each line with appropriate
# terminal sequences.
exec 3>&1
sed -u "s/^/$(tput setf 2)/" >&3 |&
exec 3>&- 1>&p
sed -u "s/^/$(tput setf 1)/" >&2 |&
exec 2>&p

# Shell program here

# Cleanup: revert to default colors, and close coprocess inputs and wait for
# them so that all output will be delivered before the shell program exits.
tput sgr0
exec 1>&- 2>&-

John DuBois spcecdt(a) KC6QKZ/AE
From: CSM 'illovae' Seldon on
"pg(a)" <phil.ganchev(a)> writes:

> Is it possible to make any of those a different color than the others?
> In any shell?

Hey, you can try grc. It have by default some recepies for ping,
traceroute, etc, but you can create your own depending what you need.


-- illovae.

CSM 'illovae' Seldon druuna (at) |
Member of dud-t group gopher:// |
----------------------------------------------------{,_,"> |
---- Sic transit hominis regnum. Gens nova omnipoten. -----+