Skip to content

Instantly share code, notes, and snippets.

@SkypLabs
Last active September 20, 2018 09:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save SkypLabs/4775d15424f68d16fbdee5818917072c to your computer and use it in GitHub Desktop.
Save SkypLabs/4775d15424f68d16fbdee5818917072c to your computer and use it in GitHub Desktop.
Bash functions to display messages with color
# Green
function echo_ok {
echo -e "\033[32m[OK]\033[0m $@"
}
# Red (using strerr as output)
function echo_err {
echo -e "\033[31m[ERROR]\033[0m $@" 1>&2
}
# Orange
function echo_war {
echo -e "\033[33m[WARNING]\033[0m $@"
}
# Blue
function echo_info {
echo -e "\033[34m[INFO]\033[0m $@"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment