Skip to content

Instantly share code, notes, and snippets.

@masonwan
Last active December 25, 2015 09:19
Show Gist options
  • Save masonwan/6953606 to your computer and use it in GitHub Desktop.
Save masonwan/6953606 to your computer and use it in GitHub Desktop.
Print all possible combinations of bash colors, according to [Advanced Bash-Scripting Guide](http://www.tldp.org/LDP/abs/html/colorizing.html)
#! /bin/bash
for isBold in {0..1}; do
for background in {40..47}; do
for foreground in {30..37}; do
colorTag='\e['$isBold';'$foreground';'$background'm'
colorResetTag='\e[0m'
text=$colorTag'isBold:'$isBold' foreground:'$foreground' background:'$background$colorResetTag
echo -e $text
done
echo '================'
done
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment