I wanted to add some colour to the output of my bash shell script and was able to do so with the following – very simple red and green:
if [ $COUNT -eq 0 ]; then
tput setaf 2
echo "OK There are no problems"
tput sgr0
else
tput setaf 1
echo "WARNING There are problems"
tput sgr0
fi