bug-grep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Prevent grep from removing the color


From: Yang Zhang
Subject: Prevent grep from removing the color
Date: Sat, 21 Jun 2008 13:06:36 -0400
User-agent: Thunderbird 2.0.0.14 (X11/20080505)

Hi, I'm interested in cascading a bunch of coloring greps to syntax-highlight lines. E.g. given the string:

  user3 changed from Online to Offline

I'd like to be able to issue something like:

  GREP_COLORS='...white...' grep user3  |
  GREP_COLORS='...green...' grep Online |
  GREP_COLORS='...red.....' grep Offline

so that I see (in my made-up markup language):

<white>user3</white> changed from <green>Online</green> to <red>Offline</red>

However, it appears that grep always resets the coloring on the non-matching portions of the line. Is there any way around this? Is there a more suitable tool (perhaps some general-purpose syntax highlighting tool)? Thanks in advance for any help!
--
Yang Zhang
http://www.mit.edu/~y_z/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]