function promptCommand()
{
LAST_STATUS=$?
# Set title of window to dir, then add new line to prompt.
PS1='\[\e]0;\w\a\]\n'
if [ $LAST_STATUS -eq 0 ]; then
((successes++))
PS1+='\[\033[1;32m\][$successes]'
else
successes=0
PS1+='\[\033[1;31m\][0 $LAST_STATUS]'
fi
PS1+='\[\033[0;32m\] '
PS1+='\w $(date +%H:%M) \$ \[\033[0m\]'
}
lastStatus=0
successes=-1
PROMPT_COMMAND="promptCommand"
My prompt: [0] /home/bar/g3 14:19 $ echo "boo"
boo
[1] /home/bar/g3 14:19 $
> I live in a gated community with only one way in and out, and I'm alerted immediately if someone should be let through if they aren't on my regular list.
The whole tone of the article as I read it was Security & Privacy for me, not for thee (people in my community, my dogs, my hypothetical kids).