How to make colors in echo output

RED=’\033[0;31m’
NC=’\033[0m’ # No Color

echo -e “${RED}Mathew${NC} Touchriver”

You can also use tput

 

red=`tput setaf 1`
green=`tput setaf 2`
reset=`tput sgr0`
echo "${red}red text ${green}green text${reset}"

Leave a Reply

Your email address will not be published. Required fields are marked *