Skip to content

Instantly share code, notes, and snippets.

@farhaven
Created October 19, 2015 17:53
Show Gist options
  • Save farhaven/28920839d3b94b11f756 to your computer and use it in GitHub Desktop.
Save farhaven/28920839d3b94b11f756 to your computer and use it in GitHub Desktop.
function foo {
typeset s=$?
if [ $s -ne 0 ]; then
echo -n "$s"
fi
}
PS1='$(foo)'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment