title: Run UNIX command in ant script - build.xml
body: <p>How to put this unix command in ant script?</p>
  
  <pre><code>jar -xvf test.ear out.war | jar -x ; cd directory ; jar -xvf ../out.war
  </code></pre>
  
  <p>Will this work?</p>
  
  <pre><code>&lt;target name="unear"&gt;
      &lt;echo&gt;***Un-tarring***&lt;/echo&gt;
      &lt;exec executable="jar" outputproperty="noOfFiles"&gt;
           &lt;arg value="-xvf" /&gt;
           &lt;arg value="test.ear out.war" /&gt;
           &lt;arg value="|" /&gt;
           &lt;arg value="jar" /&gt;
           &lt;arg value="-x" /&gt;
           &lt;arg value=";" /&gt;
           &lt;arg value="cd directory" /&gt;
           &lt;arg value=";" /&gt;
           &lt;arg value="jar" /&gt;
           &lt;arg value="-xvf" /&gt;
           &lt;arg value="../out.war" /&gt;
      &lt;/exec&gt;
  &lt;/target&gt;
  </code></pre>