Skip to content

Instantly share code, notes, and snippets.

@timofurrer
Created November 16, 2012 13:58
Show Gist options
  • Save timofurrer/4087558 to your computer and use it in GitHub Desktop.
Save timofurrer/4087558 to your computer and use it in GitHub Desktop.
bash function to show last error code in bash prompt
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