Last active
March 24, 2019 20:45
-
-
Save jnbdz/9258b82ab31a320ddadc1db411d5fe4a to your computer and use it in GitHub Desktop.
Coloring diff msg types
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
#!/usr/bin/env bash | |
# Source: https://stackoverflow.com/questions/5947742/how-to-change-the-output-color-of-echo-in-linux | |
RED='\033[0;31m' | |
YELLOW='\033[1;33m' | |
GREEN='\033[0;32m' | |
NC='\033[0m' # No Color | |
# $1 - Message | |
errorMsg() { | |
echo -e " > - ${RED}ERROR${NC} - "${1} | |
} | |
# $1 - Message | |
warningMsg() { | |
echo -e " > - ${YELLOW}WARNING${NC} - "${1} | |
} | |
# $1 - Message | |
successMsg() { | |
echo -e " > - ${GREEN}SUCCESS${NC} - "${1} | |
} | |
# $1 - Message | |
simpleMsg() { | |
echo -e " > "${1} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment