Skip to content

Instantly share code, notes, and snippets.

@tchajed
Created April 7, 2020 15:28
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 tchajed/7994472609b66d4296d0a2984f2e0e51 to your computer and use it in GitHub Desktop.
Save tchajed/7994472609b66d4296d0a2984f2e0e51 to your computer and use it in GitHub Desktop.
ANSI escapes for colors in bash
#!/bin/bash
info() {
echo -e "\033[34m$1\033[0m"
}
error() {
echo -e "\033[31m$1\033[0m"
}
warning() {
echo -e "\033[93m$1\033[0m"
}
info "info"
error "error"
warning "warning"
echo "normal"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment