title: ant: command not found
body: <p>I am having some trouble running ant. Here is a simplified verison of my problem. I have a shell script script1.sh:</p>
  
  <pre><code>export ANT_HOME=/opt/Ant
  ant -version
  </code></pre>
  
  <p>This works. but when I try create another script script2:</p>
  
  <pre><code>cd /location/of/script1
  sudo -E ./script1.sh | tee log.txt
  </code></pre>
  
  <p>I get the error <code>ant: command not found.</code> Does anyone know why this is happening.</p>