title: What is the difference between PS1 and PROMPT_COMMAND?
body: <p>While taking a look at <a href="https://web.archive.org/web/20161214154424/https://stackoverflow.com/questions/103857/what-is-your-favorite-bash-prompt" rel="noreferrer">this awesome thread</a> I noticed that some examples use</p>
  <pre><code>PS1=&quot;Blah Blah Blah&quot;
  </code></pre>
  <p>and some use</p>
  <pre><code>PROMPT_COMMAND=&quot;Blah Blah Blah&quot;
  </code></pre>
  <p>(and some use both) when setting the prompt in a Bash shell. What is the difference between the two? A Stack Overflow search and even a bit of broader Google searching aren't getting me results, so even a link to the right place to look for the answer would be appreciated.</p>