Make colored output

I found a nice script in stackoverflow about how to color the output of make in bash. It works by filtering the output and looking for certain expressions to highlight.

Placing this function definition in your .bashrc file defines a bash make function which gets executed instead of the command. This way we can shadow the real make command and create our own custom version.

   ccred=$(echo -e "33[1;31m")
   ccyellow=$(echo -e "33[1;33m")
   ccend=$(echo -e "33[0m")
   /usr/bin/make "$@" 2&gt;&amp;1 | sed -e "s/[Ee]rror:/$ccred&amp;$ccend/g" -e "s/[Ww]arning:/$ccyellow&amp;$ccend/g"
   return ${PIPESTATUS[0]}

Of course, you can use this technique to wrap other commands as well.