Created
February 24, 2013 17:53
-
-
Save jhubert/5024807 to your computer and use it in GitHub Desktop.
Generates a table of the `tput setaf` and `tput setab` colors in bash. Based on Daniel Crisman's script from the Bash Prompt HOWTO on Colours: http://tldp.org/HOWTO/Bash-Prompt-HOWTO/x329.html
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
#!/bin/bash | |
T='gYw' # The test text | |
for FGs in 0 1 2 3 4 5 6 7; | |
do FG=${FGs// /} | |
echo -en " $FGs $(tput setaf $FG) $T " | |
for BG in 0 1 2 3 4 5 6 7; | |
do echo -en "$EINS $(tput setaf $FG)$(tput setab $BG) $T $(tput sgr0)"; | |
done | |
echo; | |
echo -en "bold $FGs $(tput bold; tput setaf $FG) $T " | |
for BG in 0 1 2 3 4 5 6 7; | |
do echo -en "$EINS $(tput bold; tput setaf $FG)$(tput setab $BG) $T $(tput sgr0)"; | |
done | |
echo; | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Nice!