Created
October 1, 2014 08:12
-
-
Save leobossmann/ceace7b8ac0e93d049da to your computer and use it in GitHub Desktop.
Shell function for colored status report on last executed command
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 | |
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