title: bash - how to find current shell command
body: <p>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. </p>
  
  <pre><code>PROMPT_COMMAND='TITLE=`echo !!`; echo $TITLE;'
  </code></pre>
  
  <p>I tried using <code>echo !!</code> inside .bashrc but this simply gives me <code>!!</code> as title. Any ideas? </p>