Skip to content

Instantly share code, notes, and snippets.

@leobossmann
Created October 1, 2014 08:12
Show Gist options
  • Save leobossmann/ceace7b8ac0e93d049da to your computer and use it in GitHub Desktop.
Save leobossmann/ceace7b8ac0e93d049da to your computer and use it in GitHub Desktop.
Shell function for colored status report on last executed command
#!/bin/bash
function echo_red {
echo -e "\033[0;31m$1\033[0m"
}
function echo_green {
echo -e "\033[0;32m$1\033[0m"
}
function echo_status {
if [ $? == 0 ]; then
echo_green "done"
else
echo_red "failed"
fi
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment