On Tue, Jan 8, 2013 at 5:33 PM, Bob Ippolito <bob@redivi.com> wrote:
- Having a PS1 prompt that contained the exit code from the last command was really clever, I hadn't seen that before. I'm sure some people would be interested in what the bashrc for that prompt looks like.
Just make sure promptvars is turned on (shopt -s promptvars) and then you can use $? in $PS1. (Remember to singlequote the value of $PS1 so that $? is stored in it and not the current value of $?.)