Colorifer is set of utilities to
color output of other processes, e.g. command line utilites or
compilers. These programs make output more readable using different
color for the significant pieces of the text. For example, you can use
it to replace the color-gcc script or to colorize system logs. You only
need to create new config - set of the patterns (regular expressions)
and colors you want.
Colorifer project is divided into two parts:
- colorifer - main engine
- color-gcc - set of config
files to emulate functionality of colorgcc
is a color stream editor. It works like sed, but don't edit stream and
substitutions instead. This is a simple filter, you can use to colorize
output of any program.
Csed supports all sed like address types: '/REGEX/', 'NUMBER',
'FIRST~SEP', 'START,STOP', 'START,+NUMBER', 'START,~NUMBER'
You can also append '!' character to the end of an address
specification to negate the sense of the match.
To colorize whole string use '[address]
command with address specification,
You can also use 's/REGEX/color[,attribute]/'
command to colorize multiple substrings.
'/([a-z0-9]+):/ p blue'
See screenshot here
CSed is also an interesting for learning sed, and regular expressions.
is a wrapper to run program and colorize it's output.
It works like "some-program
2>&1|([ -f some-file] && csed -f some-file)"
command, but also return exit code of program and don't mix stdout and
stderr of the program. Colorifer's config is a set of Csed's commands.
is a srcipt to setup colorifer wrapper. For example, if you want to
colorize gcc and g++ type:
$pcolorize gcc g++
This script will creates two shell scripts in you $HOME/bin directory.
How to colorize ps system
> ps "\$@" |csed '1 p
$ chmod +x ~/bin/ps
PID TTY TIME CMD
6826 pts/1 00:00:00 bash
10254 pts/1 00:00:00 ps
10255 pts/1 00:00:00 ps
10256 pts/1 00:00:00 csed
Download latest version of colorifer here
Colorifer is written by Stanislav Ievlev and Alexey