You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Ed Mangual <ed...@s1.com> on 2001/12/05 22:47:46 UTC

Quoting issue

How do you escape apostrophes? I having a small issue running exec, I
have the following:
 
user.properties snippet
 
nshome=c\:/Program Files/Netscape/Users/default
 
build.xml snippet
 
 <property name="nscert" value="S1 Corp&apos;s VeriSign, Inc. ID"/>
                        
<exec dir="${afi.packaging.work}" executable="signtool"
failonerror="true">
<arg line="-d${nshome} -c9 -k${nscert} --verbosity -1 -Z ${archive}.jar
-e.class -e.properties . "/>
</exec>
 
 
error:
 
c:\projects\afi54\build\signcode.xml:72: unbalanced quotes in
-dc:/Program Files/Netscape/Users/default -c9 -kS1 Corp's
VeriSign, Inc. ID --verbosity -1 -Z appletBridge.jar -e.class
-e.properties .
        at
org.apache.tools.ant.types.Commandline.translateCommandline(Compiled
Code)
        at
org.apache.tools.ant.types.Commandline$Argument.setLine(Commandline.java
:127)
        at org.apache.tools.ant.IntrospectionHelper$5.set(Compiled Code)
        at
org.apache.tools.ant.IntrospectionHelper.setAttribute(Compiled Code)
        at org.apache.tools.ant.ProjectHelper.configure(Compiled Code)
        at
org.apache.tools.ant.RuntimeConfigurable.maybeConfigure(Compiled Code)
        at
org.apache.tools.ant.RuntimeConfigurable.maybeConfigure(Compiled Code)
        at org.apache.tools.ant.Task.maybeConfigure(Task.java:178)
        at org.apache.tools.ant.Task.perform(Task.java:216)
        at org.apache.tools.ant.Target.execute(Compiled Code)
        at org.apache.tools.ant.Target.performTasks(Target.java:202)
        at org.apache.tools.ant.Project.executeTarget(Compiled Code)
        at org.apache.tools.ant.Project.executeTargets(Compiled Code)
        at org.apache.tools.ant.Main.runBuild(Compiled Code)
        at org.apache.tools.ant.Main.start(Compiled Code)
        at org.apache.tools.ant.Main.main(Main.java:176)
 
 
 
I'm using ant 1.4.1, w2k sp2.
 
 
Any ideas?
 

Re: Quoting issue

Posted by Steve Loughran <st...@iseran.com>.
----- Original Message -----
From: "Frank E. Weiss" <fr...@well.com>
To: "Ant Users List" <an...@jakarta.apache.org>
Sent: Wednesday, December 05, 2001 3:00 PM
Subject: Re: Quoting issue


> As a follow up, can the documentation for the arg tage be clarified? It
says "a
> single command-line argument; can contain space characters" but seems like
it should
> include other command-line parsing break characters such as double-quote
and single
> quote.

Why not make the changes to the appropriate file, post the CVS diff -u of
that file to ant-dev and it'll make its way into the source tree:
documentation is an important contribution to any Apache project, and your
effort would be valued.

Also, what is wrong with the <signjar> task that prevented you from using
it?

-steve


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Quoting issue

Posted by "Frank E. Weiss" <fr...@well.com>.
As a follow up, can the documentation for the arg tage be clarified? It says "a
single command-line argument; can contain space characters" but seems like it should
include other command-line parsing break characters such as double-quote and single
quote.

A side note: In Perl it is a common mistake to use exec with just one parameter:

exec "$cmd $parm1 $parm2 $parm3";

instead of

exec ($cmd, $parm1, $parm2, $parm3);

The first, bad, way causes all kinds of quoting grief. Unless, of course, you WANT
the shell to parse the command line before passing it to exec().

Just remember that the arguments to main() are universally a list, not a string.



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Quoting issue

Posted by "Frank E. Weiss" <fr...@well.com>.
Try using <arg value="..."> for each exec parameter  instead of <arg
line="...">. Exec really likes a vector of strings better than having to
parse a line into words.

Ed Mangual wrote:

> How do you escape apostrophes? I having a small issue running exec, I
> have the following:
>
> user.properties snippet
>
> nshome=c\:/Program Files/Netscape/Users/default
>
> build.xml snippet
>
> <property name="nscert" value="S1 Corp&apos;sVeriSign, Inc. ID"/>
>
> <exec dir="${afi.packaging.work}"
> executable="signtool" failonerror="true">
>
> <arg line="-d${nshome} -c9 -k${nscert} --verbosity -1 -Z
> ${archive}.jar -e.class -e.properties . "/>
>
> </exec>
>
> error:
>
> c:\projects\afi54\build\signcode.xml:72: unbalanced quotes in
> -dc:/Program Files/Netscape/Users/default -c9 -kS1 Corp's
>
> VeriSign, Inc. ID --verbosity -1 -Z appletBridge.jar -e.class
> -e.properties .
>
> atorg.apache.tools.ant.types.Commandline.translateCommandline(Compiled
> Code)
>
>
> torg.apache.tools.ant.types.Commandline$Argument.setLine(Commandline.java:127)
>
> at org.apache.tools.ant.IntrospectionHelper$5.set(Compiled Code)
>
> atorg.apache.tools.ant.IntrospectionHelper.setAttribute(Compiled Code)
>
> atorg.apache.tools.ant.ProjectHelper.configure(Compiled Code)
>
> atorg.apache.tools.ant.RuntimeConfigurable.maybeConfigure(Compiled
> Code)
>
> atorg.apache.tools.ant.RuntimeConfigurable.maybeConfigure(Compiled
> Code)
>
> atorg.apache.tools.ant.Task.maybeConfigure(Task.java:178)
>
> atorg.apache.tools.ant.Task.perform(Task.java:216)
>
> atorg.apache.tools.ant.Target.execute(Compiled Code)
>
> atorg.apache.tools.ant.Target.performTasks(Target.java:202)
>
> atorg.apache.tools.ant.Project.executeTarget(Compiled Code)
>
> atorg.apache.tools.ant.Project.executeTargets(Compiled Code)
>
> atorg.apache.tools.ant.Main.runBuild(Compiled Code)
>
> atorg.apache.tools.ant.Main.start(Compiled Code)
>
> atorg.apache.tools.ant.Main.main(Main.java:176)
>
> I’m using ant 1.4.1, w2k sp2.
>
> Any ideas?
>
>    ----------------------------------------------------------------
> --
> To unsubscribe, e-mail:   <mailto:ant-user-unsubscr
> ibe@jakarta.apache.org>
> For additional commands, e-mail: <
> mailto:ant-user-help@jakarta.apache.org>
>

Re: Quoting issue

Posted by "Frank E. Weiss" <fr...@well.com>.
Unlikely, since the error is in org.apache.tools.ant.types.Commandline.translateCommandline, not signtool. See my earlier comment on passing parameters to exec with or without shell parsing.

Jill Stephenson wrote:

> The value passed to signtool probably needs to be enclosed
> in quotes, try
>
> <property name="nscert" value="&quot;S1 Corp&apos;s VeriSign, Inc.
> ID&quot;"/>
>
> --
> Jill
> ----- Original Message -----
> From: "Ed Mangual" <ed...@s1.com>
> To: <an...@jakarta.apache.org>
> Sent: Thursday, December 06, 2001 7:47 AM
> Subject: Quoting issue
>
> > How do you escape apostrophes? I having a small issue running exec, I
> > have the following:
> >
> > user.properties snippet
> >
> > nshome=c\:/Program Files/Netscape/Users/default
> >
> > build.xml snippet
> >
> >  <property name="nscert" value="S1 Corp&apos;s VeriSign, Inc. ID"/>
> >
> > <exec dir="${afi.packaging.work}" executable="signtool"
> > failonerror="true">
> > <arg line="-d${nshome} -c9 -k${nscert} --verbosity -1 -Z ${archive}.jar
> > -e.class -e.properties . "/>
> > </exec>
> >
> >
> > error:
> >
> > c:\projects\afi54\build\signcode.xml:72: unbalanced quotes in
> > -dc:/Program Files/Netscape/Users/default -c9 -kS1 Corp's
> > VeriSign, Inc. ID --verbosity -1 -Z appletBridge.jar -e.class
> > -e.properties .
> >         at
> > org.apache.tools.ant.types.Commandline.translateCommandline(Compiled
> > Code)
> >         at
> > org.apache.tools.ant.types.Commandline$Argument.setLine(Commandline.java
> > :127)
> >         at org.apache.tools.ant.IntrospectionHelper$5.set(Compiled Code)
> >         at
> > org.apache.tools.ant.IntrospectionHelper.setAttribute(Compiled Code)
> >         at org.apache.tools.ant.ProjectHelper.configure(Compiled Code)
> >         at
> > org.apache.tools.ant.RuntimeConfigurable.maybeConfigure(Compiled Code)
> >         at
> > org.apache.tools.ant.RuntimeConfigurable.maybeConfigure(Compiled Code)
> >         at org.apache.tools.ant.Task.maybeConfigure(Task.java:178)
> >         at org.apache.tools.ant.Task.perform(Task.java:216)
> >         at org.apache.tools.ant.Target.execute(Compiled Code)
> >         at org.apache.tools.ant.Target.performTasks(Target.java:202)
> >         at org.apache.tools.ant.Project.executeTarget(Compiled Code)
> >         at org.apache.tools.ant.Project.executeTargets(Compiled Code)
> >         at org.apache.tools.ant.Main.runBuild(Compiled Code)
> >         at org.apache.tools.ant.Main.start(Compiled Code)
> >         at org.apache.tools.ant.Main.main(Main.java:176)
> >
> >
> >
> > I'm using ant 1.4.1, w2k sp2.
> >
> >
> > Any ideas?
> >
> >
>
> ----------------------------------------------------------------------------
> ----
>
> > --
> > To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> > For additional commands, e-mail: <ma...@jakarta.apache.org>
>
> -----------------------------------------------------------------------------------
>
> The contents of this message are the views of the Author and do not necessarily reflect the views of SUNCORP METWAY LTD  ABN 66 010 831 722.
>
> The content of this e-mail, including attachments is a confidential communication between the Suncorp Metway Group and the intended addressee. Any unauthorised use of the contents is expressly prohibited. If you have received this e-mail in error please contact the sender immediately and then delete the message and any attachment(s).
>
> http://www.suncorpmetway.com.au
>
> --
> To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Quoting issue

Posted by Jill Stephenson <ji...@suncorpmetway.com.au>.
The value passed to signtool probably needs to be enclosed
in quotes, try

<property name="nscert" value="&quot;S1 Corp&apos;s VeriSign, Inc.
ID&quot;"/>

--
Jill
----- Original Message -----
From: "Ed Mangual" <ed...@s1.com>
To: <an...@jakarta.apache.org>
Sent: Thursday, December 06, 2001 7:47 AM
Subject: Quoting issue


> How do you escape apostrophes? I having a small issue running exec, I
> have the following:
>
> user.properties snippet
>
> nshome=c\:/Program Files/Netscape/Users/default
>
> build.xml snippet
>
>  <property name="nscert" value="S1 Corp&apos;s VeriSign, Inc. ID"/>
>
> <exec dir="${afi.packaging.work}" executable="signtool"
> failonerror="true">
> <arg line="-d${nshome} -c9 -k${nscert} --verbosity -1 -Z ${archive}.jar
> -e.class -e.properties . "/>
> </exec>
>
>
> error:
>
> c:\projects\afi54\build\signcode.xml:72: unbalanced quotes in
> -dc:/Program Files/Netscape/Users/default -c9 -kS1 Corp's
> VeriSign, Inc. ID --verbosity -1 -Z appletBridge.jar -e.class
> -e.properties .
>         at
> org.apache.tools.ant.types.Commandline.translateCommandline(Compiled
> Code)
>         at
> org.apache.tools.ant.types.Commandline$Argument.setLine(Commandline.java
> :127)
>         at org.apache.tools.ant.IntrospectionHelper$5.set(Compiled Code)
>         at
> org.apache.tools.ant.IntrospectionHelper.setAttribute(Compiled Code)
>         at org.apache.tools.ant.ProjectHelper.configure(Compiled Code)
>         at
> org.apache.tools.ant.RuntimeConfigurable.maybeConfigure(Compiled Code)
>         at
> org.apache.tools.ant.RuntimeConfigurable.maybeConfigure(Compiled Code)
>         at org.apache.tools.ant.Task.maybeConfigure(Task.java:178)
>         at org.apache.tools.ant.Task.perform(Task.java:216)
>         at org.apache.tools.ant.Target.execute(Compiled Code)
>         at org.apache.tools.ant.Target.performTasks(Target.java:202)
>         at org.apache.tools.ant.Project.executeTarget(Compiled Code)
>         at org.apache.tools.ant.Project.executeTargets(Compiled Code)
>         at org.apache.tools.ant.Main.runBuild(Compiled Code)
>         at org.apache.tools.ant.Main.start(Compiled Code)
>         at org.apache.tools.ant.Main.main(Main.java:176)
>
>
>
> I'm using ant 1.4.1, w2k sp2.
>
>
> Any ideas?
>
>


----------------------------------------------------------------------------
----


> --
> To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>


-----------------------------------------------------------------------------------

The contents of this message are the views of the Author and do not necessarily reflect the views of SUNCORP METWAY LTD  ABN 66 010 831 722. 

The content of this e-mail, including attachments is a confidential communication between the Suncorp Metway Group and the intended addressee. Any unauthorised use of the contents is expressly prohibited. If you have received this e-mail in error please contact the sender immediately and then delete the message and any attachment(s).

http://www.suncorpmetway.com.au


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>