看看colormake,找到
here
原文链接:https://www.f2er.com/bash/388528.html$ apt-cache search colormake colormake - simple wrapper around make to colorize output
使用谷歌的力量,我也发现了这个bash功能。
make() { pathpat="(/[^/]*)+:[0-9]+" ccred=$(echo -e "\033[0;31m") ccyellow=$(echo -e "\033[0;33m") ccend=$(echo -e "\033[0m") /usr/bin/make "$@" 2>&1 | sed -E -e "/[Ee]rror[: ]/ s%$pathpat%$ccred&$ccend%g" -e "/[Ww]arning[: ]/ s%$pathpat%$ccyellow&$ccend%g" return ${PIPESTATUS[0]} }