Skip to content

Instantly share code, notes, and snippets.

@deepfriedmind
Created August 3, 2015 21:34
Show Gist options
  • Save deepfriedmind/a6cdfa320c8cc842cb77 to your computer and use it in GitHub Desktop.
Save deepfriedmind/a6cdfa320c8cc842cb77 to your computer and use it in GitHub Desktop.
Output text strings in all 8 base colors + their light/bold variant (tested in bash on OS X)
#!/bin/bash
i=30
for color in "black" "red" "green" "yellow" "blue" "purple" "cyan" "white" ; do
for attr in 0 1; do
if [[ $attr == 1 ]]; then
prefix="bold/light "
else
prefix=""
fi
echo -en "\033[${attr};${i}mThis is ${prefix}${color} text\033[0m\n"
done
echo # newline
((i++))
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment