title: Ant exec shell script - loses environment
body: <p>I am trying to exec a shell script like so in Ant:</p>
  
  <pre><code>&lt;exec executable="bash" newenvironment="false" dir="./"&gt;
    &lt;arg value="script.sh"&gt;
  &lt;/exec&gt;
  </code></pre>
  
  <p>But when it executes the script, all references to environment variables such as $MY_VARIABLE come back as the empty string. How do I get around this? According to <a href="http://ant.apache.org/manual/Tasks/exec.html" rel="nofollow noreferrer">http://ant.apache.org/manual/Tasks/exec.html</a> I believe the environment should be propogated. (I also realize newenvironment defaults to false.)</p>
  
  <p>Edit: I see the env element, but I don't see a way to pass the environment in en masse. Is there a way to do that?</p>