title: How to insert an environment variable inside the bash prompt
body: <p>I can set an environment variable inside the bash prompt like this:</p>
  
  <pre><code>export PS1="[\u@\H/$FOO \W]\$ "
  </code></pre>
  
  <p>The prompt does not change when I change the environment variable: <code>$FOO</code> because the <code>$FOO</code> variable is not interpreted. </p>
  
  <p>I can work around it by doing the following, exporting PS1 again.  But I would like to be able to do it on one line:</p>
  
  <pre><code>[user@server ]$ echo $FOO
  foo
  [user@server ]$ export PS1="[$FOO]$ "
  [foo]$ export FOO=bla
  [bla]$ 
  </code></pre>
  
  <p>Can this be done in one line?</p>