echo $?
but now I have added a new line to my .bashrc that will show me this in colour.
export PS1='\[\033[0;32m\]\u@\h \[\033[0;33m\]\w\[\033[${?/[^0]/31}m\]\$ \[\033[0;38m\]'
This will make the prompt green if everything went OK and red if the process didn't return 0. Nice little helper :)
1 comment:
Yeah.. This rulz! Greets meisel
Post a Comment