The Archives

  • 12.Oct.12
    Make colored output shell | fernape | (0)
    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. make() { ccred=$(echo -e "33[1;31m") ccyellow=$(echo -e "33[1;33m") ccend=$(echo -e "33[0m") /usr/bin/make "$@" 2>&1 | sed -e "s/[Ee]rror:/$ccred&$ccend/g" -e "s/[Ww]arning:/$ccyellow&$ccend/g" return ${PIPESTATUS[0]} } Of course, you can use this ...