title: How can I use ant <exec> to execute commands on linux?
body: <p>I would like to use ant  to exectue a command like below:</p>
  
  <pre><code>&lt;exec executable="echo ptc@123 | sudo -S /app/Windchill_10.0/Apache/bin/apachectl -k stop"&gt;
  &lt;/exec&gt;
  </code></pre>
  
  <p>But it replies an error say </p>
  
  <p>The ' characters around the executable and arguments are not part of the command.</p>
  
  <p>The background is: I want to use ant to stop the apache server but it doesn't installed by the same user I run the command.</p>
  
  <p>Anyone could help or give me some clues?</p>
  
  <p>Thanks in advance</p>