title: Setting environment variable for one program call in bash using env
body: <p>I am trying to invoke a shell command with a modified environment via the command <code>env</code>.</p>
  
  <p>According to the manual</p>
  
  <pre><code>env HELLO='Hello World' echo $HELLO
  </code></pre>
  
  <p>should echo <code>Hello World</code>, but it doesn't.
  If I do</p>
  
  <pre><code>HELLO='Hello World' bash -c 'echo $HELLO'
  </code></pre>
  
  <p>it prints <code>Hello World</code> as expected (thanks to <a href="https://stackoverflow.com/a/10856348/1922650">this answer</a> for this info).</p>
  
  <p>What am I missing here?</p>
  
  <p>Cheers,
  Niklas</p>