Created
November 28, 2012 15:10
-
-
Save RobertWang/4161865 to your computer and use it in GitHub Desktop.
bash : utils : colortable
This file contains 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 | |
#llcolor | |
T='RGB' | |
fgs_a=(' m' ' 1m' ' 30m' '1;30m' ' 31m' '1;31m' ' 32m' '1;32m' ' 33m' '1;33m' ' 34m' '1;34m' ' 35m' '1;35m' ' 36m' '1;36m' ' 37m' '1;37m') | |
echo | |
echo -e "01234567012345670123456701234567012345670123456701234567012345670123456701234567" | |
echo -e "--------------------------------------------------------------------------------" | |
echo "fg \ bg | no-bg | 40m | 41m | 42m | 43m | 44m | 45m | 46m | 47m |" | |
echo -e "--------+-------+-------+-------+-------+-------+-------+-------+-------+-------" | |
for fgs in "${fgs_a[@]}" | |
do | |
fg=${fgs// /} | |
echo -en " $fgs |\033[$fg $T\033[0m " | |
for bg in 40m 41m 42m 43m 44m 45m 46m 47m | |
do | |
echo -en " \033[$fg\033[$bg $T \033[0m"; | |
done | |
echo | |
done | |
echo | |
#Shell |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment