Created
April 7, 2020 15:28
-
-
Save tchajed/7994472609b66d4296d0a2984f2e0e51 to your computer and use it in GitHub Desktop.
ANSI escapes for colors in bash
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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