Skip to content

Instantly share code, notes, and snippets.

@flackend
Last active November 12, 2018 21:06
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save flackend/ead6edeefa80d712b007 to your computer and use it in GitHub Desktop.
Save flackend/ead6edeefa80d712b007 to your computer and use it in GitHub Desktop.
echo colors cheatsheet
#!/bin/sh -e
for attr in $(seq 0 1); do
for fg in $(seq 30 37); do
for bg in $(seq 40 47); do
printf "\033[$attr;${bg};${fg}m$attr;$fg;$bg\033[m "
done
echo
done
done
@flackend
Copy link
Author

COLOR="\033[;35m"
COLOR_RST="\033[0m"

echo -e "${COLOR}My special log message${COLOR_RST}"

@flackend
Copy link
Author

Normal or bold text:

bold=$(tput bold)
normal=$(tput sgr0)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment