Created
November 16, 2012 13:58
-
-
Save timofurrer/4087558 to your computer and use it in GitHub Desktop.
bash function to show last error code in bash prompt
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
function __return_value() | |
{ | |
ret=$? | |
if [[ "$ret" -ne "0" ]]; then | |
echo -e "\033[1;31m[Error: \033[0;31m$ret\033[1;31m]\033[00m" | |
fi | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment