Advertisement
Guest User

bAndie91

a guest
Oct 29th, 2009
408
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.70 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. # prints a color table of 8bg * 8fg * 2 states (regular/bold)
  4. echo
  5. echo Table for 16-color terminal escape sequences.
  6. echo Replace ESC with \\033 in bash.
  7. echo
  8. echo "Background | Foreground colors"
  9. echo "---------------------------------------------------------------------"
  10. for((bg=40;bg<=47;bg++)); do
  11.     for((bold=0;bold<=1;bold++)) do
  12.         echo -en "\033[0m"" ESC[${bg}m   | "
  13.         for((fg=30;fg<=37;fg++)); do
  14.             if [ $bold == "0" ]; then
  15.                 echo -en "\033[${bg}m\033[${fg}m [${fg}m  "
  16.             else
  17.                 echo -en "\033[${bg}m\033[1;${fg}m [1;${fg}m"
  18.             fi
  19.         done
  20.         echo -e "\033[0m"
  21.     done
  22.     echo "--------------------------------------------------------------------- "
  23. done
  24.  
  25. echo
  26. echo
  27.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement