when compiling some projects on linux terminal, I get usually a long output consisting of a lot of information. Usually this information is MONOCHROME. I wonder if bash can be modified somehow, so in all outputs or in some specific outputs (like from Makefile, etc) I can get different colors dependeing on, for instance:
make[1]: Leaving directory
or
g++ -DHAVE_CONFIG_H -I.
etc.
Thanks
Sure, just use Bash functions, like, say this one:
(Originally via Highlight Warnings in Make.)
I found that in bash
tput setf
doesn't work. I found this commands for bash that are working wellInstalling and using colormake is another simple option.
You can do this portably by using the
tput
command and theterminfo(5)
database. For example,with terminal as standard out, will set the foreground color to purple (or something like it; I'm color blind).
tput setf 0
resets the foreground color to the default.For more information, look up
terminfo
.It seem more like you want the colorized output from make(1). In that case, I'd recommend patches for gnu make from http://git.goodpoint.de/?p=make.git;a=shortlog;h=refs/heads/color-v5.1 described on the ML: http://old.nabble.com/-rfc--Colorized-output-for-GNU-make--td32547742.html