You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by David Rosenstrauch <da...@oneworldinc.com> on 2001/05/18 20:01:44 UTC

Need help with args to exec command

Help!

Trying to execute a DOS command like this from my build.xml:

v:\netscapesigning\signing13\signtool.exe -e".class"


I tried doing this:

<exec
	dir="classes"
	executable="v:\netscapesigning\signing13\signtool.exe"
	failonerror="yes">
	<arg line="-e&quot;.class&quot;"/>
</exec>

But no dice.  Verbose output shows the command being generated as:

v:\netscapesigning\signing13\signtool.exe -e.class

Quotes are missing.  Bad.


So I tried doing this:
<exec
	dir="classes"
	executable="v:\netscapesigning\signing13\signtool.exe"
	failonerror="yes">
	<arg value="-e&quot;.class&quot;"/>
</exec>

Now the command is generated as:

v:\netscapesigning\signing13\signtool.exe '-e".class"'

Extra quotes were added.  Also bad.  Plus I get an ANT error:

"Can't handle single and double quotes in same argument"


Any ideas?


Thanks!


DR


Re: Need help with args to exec command

Posted by Ian McFarland <ia...@neo.com>.
Um, try: <arg line="-e\&quot;.class\&quot;"/> ?

I mean I'm just taking a shot in the dark, but maybe if you figure out 
the right escape sequence...

Sounds definitely like a bug, in any case.

-Ian

On Friday, May 18, 2001, at 11:01  AM, David Rosenstrauch wrote:

> Help!
>
> Trying to execute a DOS command like this from my build.xml:
>
> v:\netscapesigning\signing13\signtool.exe -e".class"
>
>
> I tried doing this:
>
> <exec
> 	dir="classes"
> 	executable="v:\netscapesigning\signing13\signtool.exe"
> 	failonerror="yes">
> 	<arg line="-e&quot;.class&quot;"/>
> </exec>
>
> But no dice.  Verbose output shows the command being generated as:
>
> v:\netscapesigning\signing13\signtool.exe -e.class
>
> Quotes are missing.  Bad.
>
>
> So I tried doing this:
> <exec
> 	dir="classes"
> 	executable="v:\netscapesigning\signing13\signtool.exe"
> 	failonerror="yes">
> 	<arg value="-e&quot;.class&quot;"/>
> </exec>
>
> Now the command is generated as:
>
> v:\netscapesigning\signing13\signtool.exe '-e".class"'
>
> Extra quotes were added.  Also bad.  Plus I get an ANT error:
>
> "Can't handle single and double quotes in same argument"
>
>
> Any ideas?
>
>
> Thanks!
>
>
> DR
>