okay - now that you have clarified your question, I offer a different answer.
In fact, the value you want is not available as an environment variable, but what about this:
tail -n 1 $HOME/.bash_history
Am I getting warmer? :)
edit:
Note that if you want to use this in your PROMPT_COMMAND , you need to do this:
export PROMPT_COMMAND='history -a; tail -n 1 $HOME/.bash_history'
hope this helps :)
simon source share