The Ant <exec> task allows us to run shell command in Ant script. We could provide input arguments like the following example which prints today’s weekday.
build.xml
<?xml version="1.0" encoding="UTF-8"?>
<project name="Ant Piped Commands" default="today" basedir=".">
<target name="today">
<exec executable="date" outputproperty="weekday">
<arg value="+%A" />
</exec>
<echo message="Today is : ${weekday}"/>
</target>
</project>

Continue reading Apache Ant – Run piped command in exec task