Skip to content

Instantly share code, notes, and snippets.

@openfly
Created April 4, 2013 03:36
Show Gist options
  • Save openfly/5307489 to your computer and use it in GitHub Desktop.
Save openfly/5307489 to your computer and use it in GitHub Desktop.
A cool bash shell prompt that displays emoticons that match up to exit status of last ran command.
#!/bin/bash
function __RETURN_CODE {
RETCODE=$?
case $RETCODE in
0) RETSTR=" 😈 " ;;
1) RETSTR=" 😭 " ;;
2) RETSTR=" 😱 " ;;
*) RETSTR=" 🐵 $RETCODE " ;;
esac
}
PROMPT_COMMAND='__RETURN_CODE'
PS1=" [ \$RETSTR ] \$ "
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment