Skip to content

Instantly share code, notes, and snippets.

@daeyun
Created June 18, 2015 16:56
Show Gist options
  • Save daeyun/630b553bf299071e1dc3 to your computer and use it in GitHub Desktop.
Save daeyun/630b553bf299071e1dc3 to your computer and use it in GitHub Desktop.
bash colored echo with "set -x"
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