Skip to content

Instantly share code, notes, and snippets.

@mbbroberg
Created December 22, 2014 15:19
Embed
What would you like to do?
Fun bash prompts
## Color green if last command successful, red otherwise
PS1="\[\`if [[ \$? = "0" ]]; then echo '\e[32m\h\e[0m'; else echo '\e[31m\h\e[0m' ; fi\`:\w\n\$
Explore more here:
http://www.reddit.com/r/programming/comments/697cu/bash_users_what_do_you_have_for_your_ps1/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment