From: John DuBois on 16 May 2010 15:04 In article <f54d87be-3a3f-4a2a-98c3-a6059d7a1abf(a)x1g2000vbo.googlegroups.com>, pg(a)gmail.com <phil.ganchev(a)gmail.com> wrote: >On May 14, 3:00�pm, spce...(a)armory.com (John DuBois) wrote: >> In article <9ca3389f-2b32-4c20-85cf-74d6ab683...(a)l28g2000yqd.googlegroups.com>, >> >> p...(a)gmail.com <phil.ganc...(a)gmail.com> wrote: >> >Is it possible to make any of those a different color than the others? >> >In any shell? >> >> This may be useful: >> >> http://groups.google.com/group/comp.unix.shell/msg/e25a5a4969a1b46b > >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>&- wait John -- John DuBois spcecdt(a)armory.com KC6QKZ/AE http://www.armory.com/~spcecdt/
From: CSM 'illovae' Seldon on 18 May 2010 16:07 "pg(a)gmail.com" <phil.ganchev(a)gmail.com> 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. http://kassiopeia.juls.savba.sk/~garabik/software/grc.html Regards, -- illovae. -- CSM 'illovae' Seldon druuna (at) dud-t.org | Member of dud-t group gopher://12.dud-t.org | ----------------------------------------------------{,_,"> | ---- Sic transit hominis regnum. Gens nova omnipoten. -----+
First
|
Prev
|
Pages: 1 2 Prev: Question about using ls Next: Find and delete empty directories recursively |