output ascii art in a red color on terminal [duplicate]
so i wanted to make a MR ROBOT default banner, but i don't know how to make the output in a red Color in terminal, could somebody please help? also does anybody have the Original MR ROBOT ascii art? if so please drop it here.
ps: using kali linux 2018.1 release
12 Answers
While tput is very handy for mobile environments, ASCII colouring is always an alternative:
echo -e "\x1B[31m MR ROBOT \x1B[0m"will output the term MR ROBOT in red font.
\x1B[31m = RED
\x1B[32m = GREEN
\x1B[96m = Blue
\x1B[01;95m = PURPLE
\x1B[01;94m = VIOLET
\x1B[01;93m = Yellow
\x1B[01;91m = ORANGE
\x1B[01;90m = GREY
\x1B[01;89m = WHITE
\x1B[0m = Back to your terminal's default colourRelated: How to change the output color of echo in Linux on Stack Overflow
0Try using this :
$ tput setaf 1; echo 'MR ROBOT'; tput sgr0And as explained in comments, do not hard-code ANSI color escape sequences in your program! The tput command lets you interact with the terminal database in a sane way: