title: shell commands not recognised when called through ANT
body: <p>I am calling a shell script from ANT build.xml on a windows machine in which I have cygwin installed. The script is getting called and the initial echo statements are being executed in the script. But it is throwing error at statements like 'sed' or 'find' in the script. When I execute the script in cygwin directly it is successfully executed. On when it is called from ANT, it thows error and build fails. I am calling the shell script from build.xml as below:</p>
  
  <pre><code>    &lt;target name="xml2prop"
      description="exec shell script"
           &gt;
      &lt;exec dir="." executable="C:\cygwin\bin\bash" osfamily="windows"&gt;    
          &lt;arg value="C:\script\testscript.sh"/&gt; 
          &lt;arg value="${root}"/&gt;
      &lt;/exec&gt; 
  &lt;/target&gt;
  </code></pre>
  
  <p>The shell script snippet is as below:</p>
  
  <pre><code>if [ $# -lt 1 ]
  then
  echo "error"
  else
  echo "\$1 is \"$1\" and total args to $0 are $# "
  rt="${1//\\//}"
  echo $rt
  fi;
  find "$rt" -name "*.xml" | 
  while read xmlfile
  do
  echo "$xmlfile";
  done
  </code></pre>
  
  <p>The error that I am getting is as below</p>
  
  <pre><code>[exec] $1 is "C:\new\test" and total args to C:\script\testscript.sh are 1
  [exec] C:/new/test
  [exec] FIND: Parameter format not correct
  </code></pre>
  
  <p>Can you please help me to figure out the problem? </p>