colored console

Coloring shell output

Using coloring, we can enhance output of shell script. Run following script in your terminal and see magic.

#!/bin/bash

#various color codes
color_lblue='\033[1;34m'
color_red='\033[1;31m'
color_lgreen='\033[1;32m'
color_custom='\033[1;33;44m'
color_no='\033[0m'

#ascii art
printf "${color_custom}"
cat <<EOF
   m""                       #                   
 mm#mm   mmm    mmm          #mmm    mmm    m mm 
   #    #" "#  #" "#         #" "#  "   #   #"  "
   #    #   #  #   #   """   #   #  m"""#   #    
   #    "#m#"  "#m#"         ##m#"  "mm"#   # 
EOF
printf "${color_no}"

 

About Rohit Chormale

I am software engineer from Hyderabad, India with primary interests in distributed systems. In my leisure time, I love to read technical papers and hacking emacs.

Leave a Reply

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