When I run a command, I need to set some shell environment variable that holds the current command from inside ".bashrc". Actually I need to update PROMPT_COMMAND whenever a command is run, and I need the whole command line, from where I will pick relevant value.
PROMPT_COMMAND='TITLE=`echo !!`; echo $TITLE;'
I tried using echo !!
inside .bashrc but this simply gives me !!
as title. Any ideas?