discoball is a tool to filter streams and colorize patterns. It functions somewhat like
except that it can highlight multiple patterns (in different colors). Patterns are arbitrary ruby regexes that
are matched against the entire line.
$ discoball [options] <pattern1 pattern2 ...>
where options are:
-g: Color all matches of the same pattern with the same color
-o: Highlight all matches with a single color
-m: Only print lines with matches
-h: Print the help message
Highlight instances of "foo" and "bar" in the text of
$ cat myfile.txt | discoball foo bar
Highlight paths of processes running out of
$ ps -ef | discoball --one_color --match '/usr/sbin/.*$'
I wrote discoball for use with Steve Losh's todo-list tool, t. I put tags on my tasks annotated with
$ t Make an appointment with the dentist +health
When I list my tasks (using
t), I use discoball to highlight the tags with different colors:
$ t | discoball '\+\S+'
(I have this aliased in bash to
tlfor ease of use.)
The easiest way to get
discoball is by using RubyGems:
$ gem install discoball. You can also clone the git
git://github.com/cespare/discoball.git if you want the latest code.