Skip to content

Instantly share code, notes, and snippets.

@adrienlucas
Created May 4, 2015 17:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save adrienlucas/72861ea642e1dcc7720c to your computer and use it in GitHub Desktop.
Save adrienlucas/72861ea642e1dcc7720c to your computer and use it in GitHub Desktop.
Bash colors PoC script
#!/bin/bash
echo ---BG---40---41---42---43---44---45---46---47
for i in {30..37} # foreground
do
echo -n -e FG$i-
for j in {40..47} # background
do
echo -n -e '\E['$i';'$j'm foo\E[0m'
done
echo # newline
done
echo -- Clear BG --
for n in {30..37} # foreground
do
echo -e FG$n '\E['$n';'01'm foo\E[0m'
done
echo
echo "Exemples : (FG/BG)"
echo -e -n " \x1b[37;41mWhite/Red\E[0m"
echo " : \\x1b[37;41m"
echo -e -n " \x1b[32;01mGreen/ - \E[0m"
echo " : \\x1b[32;01m"
echo -e -n " \x1b[33;44mYellow/Blue\E[0m"
echo " : \\x1b[33;44m"
echo ""
echo "Reset settings : "
echo " echo -ne \E[0m"
echo " tput sgr0"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment