Created
June 18, 2015 16:56
-
-
Save daeyun/630b553bf299071e1dc3 to your computer and use it in GitHub Desktop.
bash colored echo with "set -x"
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
EchoRed() { | |
{ set +x; } 2>/dev/null | |
echo "$(tput setaf 1)${1}$(tput sgr0)" | |
set -x | |
} | |
EchoGreen() { | |
{ set +x; } 2>/dev/null | |
echo "$(tput setaf 2)${1}$(tput sgr0)" | |
set -x | |
} | |
EchoGreen "hi" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment