Created
August 14, 2013 14:36
-
-
Save tonetheman/6231652 to your computer and use it in GitHub Desktop.
from this blog post http://www.fizerkhan.com/blog/posts/What-I-learned-from-other-s-shell-scripts.html amazing cool bash colors
This file contains hidden or 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 | |
| NORMAL=$(tput sgr0) | |
| GREEN=$(tput setaf 2; tput bold) | |
| RED=$(tput setaf 1) | |
| YELLOW=$(tput setaf 3) | |
| function red() { | |
| echo -e "$RED$*$NORMAL" | |
| } | |
| function yellow() { | |
| echo -e "$YELLOW$*$NORMAL" | |
| } | |
| function green() { | |
| echo -e "$GREEN$*$NORMAL" | |
| } | |
| green "[ok] - this should be green" | |
| echo "[ok] - this should be normal" | |
| yellow "[warn] - this is a warning" | |
| red "[err] - this is an error" | |
| echo "[ok] - back to normal" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment