You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

123456789101112131415161718192021222324252627282930313233343536373839
  1. #!/bin/sh
  2. # ANSI Color -- use these variables to easily have different color
  3. # and format output. Make sure to output the reset sequence after
  4. # colors (f = foreground, b = background), and use the 'off'
  5. # feature for anything you turn on.
  6. initializeANSI()
  7. {
  8. esc=""
  9. blackf="${esc}[30m"; redf="${esc}[31m"; greenf="${esc}[32m"
  10. yellowf="${esc}[33m" bluef="${esc}[34m"; purplef="${esc}[35m"
  11. cyanf="${esc}[36m"; whitef="${esc}[37m"
  12. blackb="${esc}[40m"; redb="${esc}[41m"; greenb="${esc}[42m"
  13. yellowb="${esc}[43m" blueb="${esc}[44m"; purpleb="${esc}[45m"
  14. cyanb="${esc}[46m"; whiteb="${esc}[47m"
  15. boldon="${esc}[1m"; boldoff="${esc}[22m"
  16. italicson="${esc}[3m"; italicsoff="${esc}[23m"
  17. ulon="${esc}[4m"; uloff="${esc}[24m"
  18. invon="${esc}[7m"; invoff="${esc}[27m"
  19. reset="${esc}[0m"
  20. }
  21. # note in this first use that switching colors doesn't require a reset
  22. # first - the new color overrides the old one.
  23. initializeANSI
  24. cat << EOF
  25. ${redf}▒▒▒▒${reset} ${boldon}${redf}▒▒${reset} ${greenf}▒▒▒▒${reset} ${boldon}${greenf}▒▒${reset} ${yellowf}▒▒▒▒${reset} ${boldon}${yellowf}▒▒${reset} ${bluef}▒▒▒▒${reset} ${boldon}${bluef}▒▒${reset} ${purplef}▒▒▒▒${reset} ${boldon}${purplef}▒▒${reset} ${cyanf}▒▒▒▒${reset} ${boldon}${cyanf}▒▒${reset}
  26. ${redf}▒▒ ■${reset} ${boldon}${redf}▒▒${reset} ${greenf}▒▒ ■${reset} ${boldon}${greenf}▒▒${reset} ${yellowf}▒▒ ■${reset} ${boldon}${yellowf}▒▒${reset} ${bluef}▒▒ ■${reset} ${boldon}${bluef}▒▒${reset} ${purplef}▒▒ ■${reset} ${boldon}${purplef}▒▒${reset} ${cyanf}▒▒ ■${reset} ${boldon}${cyanf}▒▒${reset}
  27. ${redf}▒▒ ${reset}${boldon}${redf}▒▒▒▒${reset} ${greenf}▒▒ ${reset}${boldon}${greenf}▒▒▒▒${reset} ${yellowf}▒▒ ${reset}${boldon}${yellowf}▒▒▒▒${reset} ${bluef}▒▒ ${reset}${boldon}${bluef}▒▒▒▒${reset} ${purplef}▒▒ ${reset}${boldon}${purplef}▒▒▒▒${reset} ${cyanf}▒▒ ${reset}${boldon}${cyanf}▒▒▒▒${reset}
  28. EOF