You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by "Peters, John" <Jo...@bcbsfl.com> on 2008/07/15 23:26:52 UTC

Pass Quotes to arg line

Hello,
I'm trying to pass quotes to the arg line for a parameter that has
spaces in it.
I've tried &quot; but that didn't seem to work.
Also tried "" \".
Any suggestions?

<target name="call_tfsbuild" depends="process_proj">
  <exec executable="${os.tfsbuild}" failonerror="true">
  <arg line="start ${os.tfsmstr} ${cc.vob} ${cc.proj}
/msBuildArguments:/p:LabelComment=Label for Build at ${local.time.start}
" />	
  </exec>  
</target>



Blue Cross Blue Shield of Florida, Inc., and its subsidiary and affiliate companies are not responsible for errors or omissions in this e-mail message. Any personal comments made in this e-mail do not reflect the views of Blue Cross Blue Shield of Florida, Inc.  The information contained in this document may be confidential and intended solely for the use of the individual or entity to whom it is addressed.  This document may contain material that is privileged or protected from disclosure under applicable law.  If you are not the intended recipient or the individual responsible for delivering to the intended recipient, please (1) be advised that any use, dissemination, forwarding, or copying of this document IS STRICTLY PROHIBITED; and (2) notify sender immediately by telephone and destroy the document. THANK YOU.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Re: Pass Quotes to arg line

Posted by JimCant <jc...@head.cfa.harvard.edu>.
The ant manual, of all things, says the following:
    It is highly recommended to avoid the line version when possible. Ant
will try to split the command
   line in a way similar to      what a (Unix) shell would do, but may
create something that is v
   different from what you expect under some circumstances.
   Examples
         <arg value="-l -a"/>
   is a single command-line argument containing a space character, not
separate commands "-l" and "-a".
           <arg line="-l -a"/>
   This is a command line with two separate arguments, "-l" and "-a".

Using a separate <arg value... for each argument makes the space issue to
away.  See the 'exec' task and look for the link to command line arguements.



Peters, John wrote:
> 
> Hello,
> I'm trying to pass quotes to the arg line for a parameter that has
> spaces in it.
> I've tried &quot; but that didn't seem to work.
> Also tried "" \".
> Any suggestions?
> 
> <target name="call_tfsbuild" depends="process_proj">
>   <exec executable="${os.tfsbuild}" failonerror="true">
>   <arg line="start ${os.tfsmstr} ${cc.vob} ${cc.proj}
> /msBuildArguments:/p:LabelComment=Label for Build at ${local.time.start}
> " />	
>   </exec>  
> </target>
> 
> 
> 
> Blue Cross Blue Shield of Florida, Inc., and its subsidiary and affiliate
> companies are not responsible for errors or omissions in this e-mail
> message. Any personal comments made in this e-mail do not reflect the
> views of Blue Cross Blue Shield of Florida, Inc.  The information
> contained in this document may be confidential and intended solely for the
> use of the individual or entity to whom it is addressed.  This document
> may contain material that is privileged or protected from disclosure under
> applicable law.  If you are not the intended recipient or the individual
> responsible for delivering to the intended recipient, please (1) be
> advised that any use, dissemination, forwarding, or copying of this
> document IS STRICTLY PROHIBITED; and (2) notify sender immediately by
> telephone and destroy the document. THANK YOU.
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Pass-Quotes-to-arg-line-tp18475283p18487288.html
Sent from the Ant - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


RE: Pass Quotes to arg line

Posted by "Peters, John" <Jo...@bcbsfl.com>.
Thank you but that doesn't seem to work with the arg line command. 

-----Original Message-----
From: Rebhan, Gilbert [mailto:Gilbert.Rebhan@huk-coburg.de] 
Sent: Wednesday, July 16, 2008 3:59 AM
To: Ant Users List
Subject: RE: Pass Quotes to arg line


-----Original Message-----
From: Lars Monsees [mailto:l.monsees@atlantisgmbh.de]
Sent: Wednesday, July 16, 2008 9:51 AM
To: Ant Users List
Subject: RE: Pass Quotes to arg line

/*
> Hello,
> I'm trying to pass quotes to the arg line for a parameter that has 
> spaces in it.
> I've tried &quot; but that didn't seem to work.
> Also tried "" \".
> Any suggestions?

I´ve had the same problem some time ago, s. http://tinyurl.com/66tvbv

Unfortunately, I haven´t found a solution to this problem.
*/

see =
http://marc.info/?l=ant-user&m=121434176300591&w=2


short =
escape "with ', means

'... "foobar" .... '

Regards, Gilbert

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org For additional commands, e-mail: user-help@ant.apache.org





Blue Cross Blue Shield of Florida, Inc., and its subsidiary and affiliate companies are not responsible for errors or omissions in this e-mail message. Any personal comments made in this e-mail do not reflect the views of Blue Cross Blue Shield of Florida, Inc.  The information contained in this document may be confidential and intended solely for the use of the individual or entity to whom it is addressed.  This document may contain material that is privileged or protected from disclosure under applicable law.  If you are not the intended recipient or the individual responsible for delivering to the intended recipient, please (1) be advised that any use, dissemination, forwarding, or copying of this document IS STRICTLY PROHIBITED; and (2) notify sender immediately by telephone and destroy the document. THANK YOU.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


RE: Pass Quotes to arg line

Posted by "Rebhan, Gilbert" <Gi...@huk-coburg.de>.
-----Original Message-----
From: Lars Monsees [mailto:l.monsees@atlantisgmbh.de] 
Sent: Wednesday, July 16, 2008 9:51 AM
To: Ant Users List
Subject: RE: Pass Quotes to arg line

/*
> Hello,
> I'm trying to pass quotes to the arg line for a parameter that has
> spaces in it.
> I've tried &quot; but that didn't seem to work.
> Also tried "" \".
> Any suggestions?

I´ve had the same problem some time ago,
s. http://tinyurl.com/66tvbv

Unfortunately, I haven´t found a solution to this problem.
*/

see =
http://marc.info/?l=ant-user&m=121434176300591&w=2


short =
escape "with ', means

'... "foobar" .... '

Regards, Gilbert

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


RE: Pass Quotes to arg line

Posted by Lars Monsees <l....@atlantisgmbh.de>.
Hi John,

> Hello,
> I'm trying to pass quotes to the arg line for a parameter that has
> spaces in it.
> I've tried &quot; but that didn't seem to work.
> Also tried "" \".
> Any suggestions?

I´ve had the same problem some time ago,
s. http://tinyurl.com/66tvbv

Unfortunately, I haven´t found a solution to this problem.


Lars

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


RE: Pass Quotes to arg line

Posted by "Peters, John" <Jo...@bcbsfl.com>.
Thank you very much for the work around 

-----Original Message-----
From: Scot P. Floess [mailto:floess@mindspring.com] 
Sent: Wednesday, July 16, 2008 9:26 AM
To: Ant Users List
Subject: Re: Pass Quotes to arg line

I have a solution for you that works :)  Took me a little googling...but
this should do what you want...  Please note, the Bash shell script
below is entitled myscript.sh and "lives" next to the build.xml:

<project  default = "try">
     <target name="try">
         <exec executable="./myscript.sh" failonerror="true">
             <arg line="start &#8220;this is a test&#8221;"/>
         </exec>
     </target>
</project>


#!/bin/bash

echo "Command line params = [$*]"

echo " "
echo "Each param:"
for aParam in $*
do
     echo "    [$aParam]"
done


Here is the link where I found the numerics I used above:

http://www.dwheeler.com/essays/quotes-in-html.html

I tried the &quot; as well...to no avail...  And yes \" didn't work
either...

However when I run the above Ant script in conjunction with the Bash
shell script, I get the following output:

Buildfile: build.xml

try:
      [exec] Command line params = [start "this is a test"]
      [exec]
      [exec] Each param:
      [exec]     [start]
      [exec]     ["this]
      [exec]     [is]
      [exec]     [a]
      [exec]     [test"]

Hope that helps :)

Flossy


On Tue, 15 Jul 2008, Peters, John wrote:

> Hello,
> I'm trying to pass quotes to the arg line for a parameter that has 
> spaces in it.
> I've tried &quot; but that didn't seem to work.
> Also tried "" \".
> Any suggestions?
>
> <target name="call_tfsbuild" depends="process_proj">  <exec 
> executable="${os.tfsbuild}" failonerror="true">  <arg line="start 
> ${os.tfsmstr} ${cc.vob} ${cc.proj} 
> /msBuildArguments:/p:LabelComment=Label for Build at 
> ${local.time.start} " />  </exec> </target>
>
>
>
> Blue Cross Blue Shield of Florida, Inc., and its subsidiary and
affiliate companies are not responsible for errors or omissions in this
e-mail message. Any personal comments made in this e-mail do not reflect
the views of Blue Cross Blue Shield of Florida, Inc.  The information
contained in this document may be confidential and intended solely for
the use of the individual or entity to whom it is addressed.  This
document may contain material that is privileged or protected from
disclosure under applicable law.  If you are not the intended recipient
or the individual responsible for delivering to the intended recipient,
please (1) be advised that any use, dissemination, forwarding, or
copying of this document IS STRICTLY PROHIBITED; and (2) notify sender
immediately by telephone and destroy the document. THANK YOU.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org For additional

> commands, e-mail: user-help@ant.apache.org
>
>

Scot P. Floess
27 Lake Royale
Louisburg, NC  27549

252-478-8087 (Home)
919-754-4592 (Work)

Chief Architect JPlate   http://sourceforge.net/projects/jplate
Chief Architect JavaPIM  http://sourceforge.net/projects/javapim

Architect Keros          http://sourceforge.net/projects/keros

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org For additional
commands, e-mail: user-help@ant.apache.org





Blue Cross Blue Shield of Florida, Inc., and its subsidiary and affiliate companies are not responsible for errors or omissions in this e-mail message. Any personal comments made in this e-mail do not reflect the views of Blue Cross Blue Shield of Florida, Inc.  The information contained in this document may be confidential and intended solely for the use of the individual or entity to whom it is addressed.  This document may contain material that is privileged or protected from disclosure under applicable law.  If you are not the intended recipient or the individual responsible for delivering to the intended recipient, please (1) be advised that any use, dissemination, forwarding, or copying of this document IS STRICTLY PROHIBITED; and (2) notify sender immediately by telephone and destroy the document. THANK YOU.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Re: Pass Quotes to arg line

Posted by "Scot P. Floess" <fl...@mindspring.com>.
I have a solution for you that works :)  Took me a little googling...but 
this should do what you want...  Please note, the Bash shell script below 
is entitled myscript.sh and "lives" next to the build.xml:

<project  default = "try">
     <target name="try">
         <exec executable="./myscript.sh" failonerror="true">
             <arg line="start &#8220;this is a test&#8221;"/>
         </exec>
     </target>
</project>


#!/bin/bash

echo "Command line params = [$*]"

echo " "
echo "Each param:"
for aParam in $*
do
     echo "    [$aParam]"
done


Here is the link where I found the numerics I used above:

http://www.dwheeler.com/essays/quotes-in-html.html

I tried the &quot; as well...to no avail...  And yes \" didn't work 
either...

However when I run the above Ant script in conjunction with the Bash shell 
script, I get the following output:

Buildfile: build.xml

try:
      [exec] Command line params = [start "this is a test"]
      [exec]
      [exec] Each param:
      [exec]     [start]
      [exec]     ["this]
      [exec]     [is]
      [exec]     [a]
      [exec]     [test"]

Hope that helps :)

Flossy


On Tue, 15 Jul 2008, Peters, John wrote:

> Hello,
> I'm trying to pass quotes to the arg line for a parameter that has
> spaces in it.
> I've tried &quot; but that didn't seem to work.
> Also tried "" \".
> Any suggestions?
>
> <target name="call_tfsbuild" depends="process_proj">
>  <exec executable="${os.tfsbuild}" failonerror="true">
>  <arg line="start ${os.tfsmstr} ${cc.vob} ${cc.proj}
> /msBuildArguments:/p:LabelComment=Label for Build at ${local.time.start}
> " />
>  </exec>
> </target>
>
>
>
> Blue Cross Blue Shield of Florida, Inc., and its subsidiary and affiliate companies are not responsible for errors or omissions in this e-mail message. Any personal comments made in this e-mail do not reflect the views of Blue Cross Blue Shield of Florida, Inc.  The information contained in this document may be confidential and intended solely for the use of the individual or entity to whom it is addressed.  This document may contain material that is privileged or protected from disclosure under applicable law.  If you are not the intended recipient or the individual responsible for delivering to the intended recipient, please (1) be advised that any use, dissemination, forwarding, or copying of this document IS STRICTLY PROHIBITED; and (2) notify sender immediately by telephone and destroy the document. THANK YOU.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
>
>

Scot P. Floess
27 Lake Royale
Louisburg, NC  27549

252-478-8087 (Home)
919-754-4592 (Work)

Chief Architect JPlate   http://sourceforge.net/projects/jplate
Chief Architect JavaPIM  http://sourceforge.net/projects/javapim

Architect Keros          http://sourceforge.net/projects/keros

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


RE: Pass Quotes to arg line

Posted by "Scot P. Floess" <fl...@mindspring.com>.
So, assuming one does this, how would one put quotes in place around 
params?

On Wed, 16 Jul 2008, Karr, David wrote:

> As another poster pointed out, the correct solution is to use multiple
> "arg"s with "value" attributes, not trying to figure out how to get
> through the various escaping layers with the "line" attribute.
>
>> -----Original Message-----
>> From: Peters, John [mailto:John.Peters@bcbsfl.com]
>> Sent: Tuesday, July 15, 2008 2:27 PM
>> To: user@ant.apache.org
>> Subject: Pass Quotes to arg line
>>
>> Hello,
>> I'm trying to pass quotes to the arg line for a parameter
>> that has spaces in it.
>> I've tried &quot; but that didn't seem to work.
>> Also tried "" \".
>> Any suggestions?
>>
>> <target name="call_tfsbuild" depends="process_proj">
>>   <exec executable="${os.tfsbuild}" failonerror="true">
>>   <arg line="start ${os.tfsmstr} ${cc.vob} ${cc.proj}
>> /msBuildArguments:/p:LabelComment=Label for Build at
>> ${local.time.start}
>> " />
>>   </exec>
>> </target>
>>
>>
>>
>> Blue Cross Blue Shield of Florida, Inc., and its subsidiary
>> and affiliate companies are not responsible for errors or
>> omissions in this e-mail message. Any personal comments made
>> in this e-mail do not reflect the views of Blue Cross Blue
>> Shield of Florida, Inc.  The information contained in this
>> document may be confidential and intended solely for the use
>> of the individual or entity to whom it is addressed.  This
>> document may contain material that is privileged or protected
>> from disclosure under applicable law.  If you are not the
>> intended recipient or the individual responsible for
>> delivering to the intended recipient, please (1) be advised
>> that any use, dissemination, forwarding, or copying of this
>> document IS STRICTLY PROHIBITED; and (2) notify sender
>> immediately by telephone and destroy the document. THANK YOU.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org For
>> additional commands, e-mail: user-help@ant.apache.org
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
>
>

Scot P. Floess
27 Lake Royale
Louisburg, NC  27549

252-478-8087 (Home)
919-754-4592 (Work)

Chief Architect JPlate   http://sourceforge.net/projects/jplate
Chief Architect JavaPIM  http://sourceforge.net/projects/javapim

Architect Keros          http://sourceforge.net/projects/keros

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


RE: Pass Quotes to arg line

Posted by "Karr, David" <da...@wamu.net>.
As another poster pointed out, the correct solution is to use multiple
"arg"s with "value" attributes, not trying to figure out how to get
through the various escaping layers with the "line" attribute. 

> -----Original Message-----
> From: Peters, John [mailto:John.Peters@bcbsfl.com] 
> Sent: Tuesday, July 15, 2008 2:27 PM
> To: user@ant.apache.org
> Subject: Pass Quotes to arg line
> 
> Hello,
> I'm trying to pass quotes to the arg line for a parameter 
> that has spaces in it.
> I've tried &quot; but that didn't seem to work.
> Also tried "" \".
> Any suggestions?
> 
> <target name="call_tfsbuild" depends="process_proj">
>   <exec executable="${os.tfsbuild}" failonerror="true">
>   <arg line="start ${os.tfsmstr} ${cc.vob} ${cc.proj} 
> /msBuildArguments:/p:LabelComment=Label for Build at 
> ${local.time.start}
> " />	
>   </exec>
> </target>
> 
> 
> 
> Blue Cross Blue Shield of Florida, Inc., and its subsidiary 
> and affiliate companies are not responsible for errors or 
> omissions in this e-mail message. Any personal comments made 
> in this e-mail do not reflect the views of Blue Cross Blue 
> Shield of Florida, Inc.  The information contained in this 
> document may be confidential and intended solely for the use 
> of the individual or entity to whom it is addressed.  This 
> document may contain material that is privileged or protected 
> from disclosure under applicable law.  If you are not the 
> intended recipient or the individual responsible for 
> delivering to the intended recipient, please (1) be advised 
> that any use, dissemination, forwarding, or copying of this 
> document IS STRICTLY PROHIBITED; and (2) notify sender 
> immediately by telephone and destroy the document. THANK YOU.
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org For 
> additional commands, e-mail: user-help@ant.apache.org
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org