Created
January 28, 2020 18:16
-
-
Save cpedro/7ee4a60fa6d8d0975b5185da0434fdf6 to your computer and use it in GitHub Desktop.
Print out colours in a enabled terminal
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bash | |
| # Simple script to print out some colour codes to the terminal to show | |
| # what's available. This can be expanded to included more codes easily | |
| # by editing the for loops. | |
| echo | |
| echo "Prepend code with \\e[" | |
| for attr in {0..5} 7 | |
| do | |
| for fgcl in {30..37} | |
| do | |
| for bgcl in "" {40..47} | |
| do | |
| [ "${bgcl}" != "" ] && bgcl=";$bgcl" | |
| printf "\e[${attr};${fgcl}${bgcl}m${attr};${fgcl}${bgcl}m\e[0m " | |
| done | |
| echo | |
| done | |
| done | |
| echo |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment