I\'ve gotten this script I\'ve created in Bash, and one of the functions I\'m using is echo
and I\'m using the -e
flag for interpretations of
Remove the trailing backslashes and add a closing quote:
NC='\033[31;0m' # no colors or formatting
RED='\033[0;31;1m' # print text in bold red
PUR='\033[0;35;1m' # print text in bold purple
YEL='\033[0;33;1m' # print text in bold Yellow
GRA='\033[0;37;1m' # print text in bold Gray
echo -e "This ${YEL}Message${NC} has color\nwith ${RED}new${NC} lines."
And it works as expected in bash
.
If you save this script into a file, run it like bash
.
Try type -a echo
to see what it is. The first line of output should be echo is a shell builtin
:
$ type -a echo
echo is a shell builtin
echo is /usr/bin/echo
echo is /bin/echo