ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dave Westerman <>
Subject Re: Issues With Quotes
Date Wed, 06 Nov 2013 14:34:33 GMT
Earl, thanks, that did it! I didn't even have to change the quotes on it, 
it worked just like this:

<arg value="&quot;@{file}&quot;" />

Having said all that, I actually changed this particular code to use the 
Ant 'resourcecontains' condition instead, when it hit me that I didn't 
need to use a Windows command for this.


From:   Earl Hood <>
To:     Ant Users List <>, 
Date:   11/05/2013 08:23 PM
Subject:        Re: Issues With Quotes
Sent by:

On 11/5/13, Dave Westerman wrote:

> I'm passing in an attribute that contains a value to search for in a 
> in Windows. I'm doing this:
> <exec executable="cmd.exe"
>         resultproperty="retcode"
>         outputproperty="output">
>     <arg line="/c findstr /c:&quot;@{value}&quot; @{file}" />
> </exec>

I normally avoid using <arg line> since some additional parsing is done
by Ant (or the sub-shell), and it may mess things up.  Break up the
arguments like the following to see if things work:

  <exec executable="cmd.exe"
      <arg value="/c" />
      <arg value="findstr" />
      <arg value='/c:"@{value}"' />
      <arg value="@{file}" />

Note, not sure if the double-quotes are still required around @{value}
or not, you will have to test things out.  Windows batch (cmd.exe)
syntax is ugly, especially when dealing with quotes.


To unsubscribe, e-mail:
For additional commands, e-mail:

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message