Advertisement
metalx1000

BASH Shell Script Color Library

Aug 23rd, 2014
3,983
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.69 KB | None | 0 0
  1. #!/bin/bash
  2. #Based on post at:
  3. #http://www.reddit.com/r/linux/comments/qagsu/easy_colors_for_shell_scripts_color_library/
  4.  
  5.  bold=`echo -en "\e[1m"`
  6.  underline=`echo -en "\e[4m"`
  7.  dim=`echo -en "\e[2m"`
  8.  strickthrough=`echo -en "\e[9m"`
  9.  blink=`echo -en "\e[5m"`
  10.  reverse=`echo -en "\e[7m"`
  11.  hidden=`echo -en "\e[8m"`
  12.  normal=`echo -en "\e[0m"`
  13.  black=`echo -en "\e[30m"`
  14.  red=`echo -en "\e[31m"`
  15.  green=`echo -en "\e[32m"`
  16.  orange=`echo -en "\e[33m"`
  17.  blue=`echo -en "\e[34m"`
  18.  purple=`echo -en "\e[35m"`
  19.  aqua=`echo -en "\e[36m"`
  20.  gray=`echo -en "\e[37m"`
  21.  darkgray=`echo -en "\e[90m"`
  22.  lightred=`echo -en "\e[91m"`
  23.  lightgreen=`echo -en "\e[92m"`
  24.  lightyellow=`echo -en "\e[93m"`
  25.  lightblue=`echo -en "\e[94m"`
  26.  lightpurple=`echo -en "\e[95m"`
  27.  lightaqua=`echo -en "\e[96m"`
  28.  white=`echo -en "\e[97m"`
  29.  default=`echo -en "\e[39m"`
  30.  BLACK=`echo -en "\e[40m"`
  31.  RED=`echo -en "\e[41m"`
  32.  GREEN=`echo -en "\e[42m"`
  33.  ORANGE=`echo -en "\e[43m"`
  34.  BLUE=`echo -en "\e[44m"`
  35.  PURPLE=`echo -en "\e[45m"`
  36.  AQUA=`echo -en "\e[46m"`
  37.  GRAY=`echo -en "\e[47m"`
  38.  DARKGRAY=`echo -en "\e[100m"`
  39.  LIGHTRED=`echo -en "\e[101m"`
  40.  LIGHTGREEN=`echo -en "\e[102m"`
  41.  LIGHTYELLOW=`echo -en "\e[103m"`
  42.  LIGHTBLUE=`echo -en "\e[104m"`
  43.  LIGHTPURPLE=`echo -en "\e[105m"`
  44.  LIGHTAQUA=`echo -en "\e[106m"`
  45.  WHITE=`echo -en "\e[107m"`
  46.  DEFAULT=`echo -en "\e[49m"`
  47.  
  48. clear
  49.  
  50. echo "${purple}This is purple"
  51. echo "${red}This is red"
  52. echo "$normal"
  53.  
  54. echo "${underline}This is underlined"
  55. echo "${blue}This is underlined and blue"
  56. echo "$normal"
  57.  
  58. echo "${GREEN}The background is green"
  59. echo "${lightblue}and the text is light blue"
  60. echo "$normal"
  61.  
  62. echo "${strickthrough}This has a line through it"
  63. echo "$normal"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement