Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
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