Earl, thanks, that did it! I didn't even have to change the quotes on it,
it worked just like this:
<arg value=""@{file}"" />
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.
Thanks!
DLW
From: Earl Hood <[email protected]>
To: Ant Users List <[email protected]>,
Date: 11/05/2013 08:23 PM
Subject: Re: Issues With Quotes
Sent by: [email protected]
On 11/5/13, Dave Westerman wrote:
> I'm passing in an attribute that contains a value to search for in a
file
> in Windows. I'm doing this:
>
> <exec executable="cmd.exe"
> resultproperty="retcode"
> outputproperty="output">
> <arg line="/c findstr /c:"@{value}" @{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"
resultproperty="retcode"
outputproperty="output">
<arg value="/c" />
<arg value="findstr" />
<arg value='/c:"@{value}"' />
<arg value="@{file}" />
</exec>
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.
--ewh
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]