You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Sean LeBlanc <se...@nutros.com> on 2002/06/28 17:51:10 UTC

How to put quotes inside the arg line for exec?

Hi all, I'm trying to get quotes to show up on an actual command line. I'm trying to
get a task made that will get all files from Visual Source Safe. I have a directory with
spaces in it, so I need to put quotes around the -gl parm. Here's what I'm trying to
run:

c:\development\visual studio\vss\win32\ss.exe get -i- -glc:\Program Files\Apache Tomcat 4.0\webapps\Nutros\home\ -r
$/MyProject/subproject/ -Yuser,pwd

Here is my code:

<!-- VSS: Get the pages -->
<target name="getpages">
	<exec dir="${vsshome}" executable="ss.exe" os="Windows 2000">
		<arg line=" get -i- -gl${jsphome} -r ${jspproject} -Y${vssuser},${vsspassword}"/>
	</exec>
</target>

Because jsphome property has spaces in it, I get:
c:\sean\ant\nutrosant.xml:121: Execute failed: java.io.IOException:
CreateProcess: ss.exe get -i- -glc:\Program Files\Apache Tomcat 4.0\webapps\Nutros\home -r
$/MyProject/subproject/ -Yuser,pwd error=2

When I try:
<!-- VSS: Get the pages -->
<target name="getpages">
	<exec dir="${vsshome}" executable="ss.exe" os="Windows 2000">
		<arg line=" get -i- -\"gl${jsphome}\" -r ${jspproject} -Y${vssuser},${vsspassword}"/>
	</exec>
</target>

I get:
c:\sean\ant\nutrosant.xml:122: Whitespace required before attributes.




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


RE: How to put quotes inside the arg line for exec?

Posted by Diane Holt <ho...@yahoo.com>.
--- Sean LeBlanc <se...@nutros.com> wrote:
> Now, I'm trying to
> figure out how to execute something that resides in a path with
> a space in it. 

> <env key="PATH" value="${java.library.path}:${vsshome}"/>

Use path=... instead of value=..., and try setting whichever of those
properties it is that has the dir with a space, using, eg:
  <property name="tempdir" location='${env.TEMP}/"Spaced Dir"'/>

Diane

=====
(holtdl@yahoo.com)



__________________________________________________
Do You Yahoo!?
Yahoo! - Official partner of 2002 FIFA World Cup
http://fifaworldcup.yahoo.com

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


RE: How to put quotes inside the arg line for exec?

Posted by Sean LeBlanc <se...@nutros.com>.

> -----Original Message-----
> From: Lou Fox [mailto:loufox@cloud9.net]
> Sent: Friday, June 28, 2002 9:58 AM
> To: Ant Users List; sean@nutros.com
> Subject: Re: How to put quotes inside the arg line for exec?
> 
> 
> use &quot;

Thanks. Works like a charm - for that part. Now, I'm trying to
figure out how to execute something that resides in a path with
a space in it. I keep getting error 2, which I read in the docs
typically means (on Windows) "not found". When I actually add
the path into my PATH (outside of Ant) it works.

I tried doing this inside the exec directive:

<env key="PATH" value="${java.library.path}:${vsshome}"/>

(I've also tried semicolon)

but it still does not work unless I change the PATH manually (outside
of Ant).

Any ideas?

Thanks.

> ----- Original Message -----
> From: "Sean LeBlanc" <se...@nutros.com>
> To: <an...@jakarta.apache.org>
> Sent: Friday, June 28, 2002 11:51 AM
> Subject: How to put quotes inside the arg line for exec?
> 
> 
> > Hi all, I'm trying to get quotes to show up on an actual 
> command line. I'm
> trying to
> > get a task made that will get all files from Visual Source 
> Safe. I have a
> directory with
> > spaces in it, so I need to put quotes around the -gl parm. 
> Here's what I'm
> trying to
> > run:
> >
> > c:\development\visual studio\vss\win32\ss.exe get -i- -glc:\Program
> Files\Apache Tomcat 4.0\webapps\Nutros\home\ -r
> > $/MyProject/subproject/ -Yuser,pwd
> >
> > Here is my code:
> >
> > <!-- VSS: Get the pages -->
> > <target name="getpages">
> > <exec dir="${vsshome}" executable="ss.exe" os="Windows 2000">
> > <arg line=" get -i- -gl${jsphome} -r
> ${jspproject} -Y${vssuser},${vsspassword}"/>
> > </exec>
> > </target>
> >
> > Because jsphome property has spaces in it, I get:
> > c:\sean\ant\nutrosant.xml:121: Execute failed: java.io.IOException:
> > CreateProcess: ss.exe get -i- -glc:\Program Files\Apache Tomcat
> 4.0\webapps\Nutros\home -r
> > $/MyProject/subproject/ -Yuser,pwd error=2
> >
> > When I try:
> > <!-- VSS: Get the pages -->
> > <target name="getpages">
> > <exec dir="${vsshome}" executable="ss.exe" os="Windows 2000">
> > <arg line=" get -i- -\"gl${jsphome}\" -r
> ${jspproject} -Y${vssuser},${vsspassword}"/>
> > </exec>
> > </target>
> >
> > I get:
> > c:\sean\ant\nutrosant.xml:122: Whitespace required before 
> attributes.



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


Re: How to put quotes inside the arg line for exec?

Posted by Lou Fox <lo...@cloud9.net>.
use &quot;
----- Original Message -----
From: "Sean LeBlanc" <se...@nutros.com>
To: <an...@jakarta.apache.org>
Sent: Friday, June 28, 2002 11:51 AM
Subject: How to put quotes inside the arg line for exec?


> Hi all, I'm trying to get quotes to show up on an actual command line. I'm
trying to
> get a task made that will get all files from Visual Source Safe. I have a
directory with
> spaces in it, so I need to put quotes around the -gl parm. Here's what I'm
trying to
> run:
>
> c:\development\visual studio\vss\win32\ss.exe get -i- -glc:\Program
Files\Apache Tomcat 4.0\webapps\Nutros\home\ -r
> $/MyProject/subproject/ -Yuser,pwd
>
> Here is my code:
>
> <!-- VSS: Get the pages -->
> <target name="getpages">
> <exec dir="${vsshome}" executable="ss.exe" os="Windows 2000">
> <arg line=" get -i- -gl${jsphome} -r
${jspproject} -Y${vssuser},${vsspassword}"/>
> </exec>
> </target>
>
> Because jsphome property has spaces in it, I get:
> c:\sean\ant\nutrosant.xml:121: Execute failed: java.io.IOException:
> CreateProcess: ss.exe get -i- -glc:\Program Files\Apache Tomcat
4.0\webapps\Nutros\home -r
> $/MyProject/subproject/ -Yuser,pwd error=2
>
> When I try:
> <!-- VSS: Get the pages -->
> <target name="getpages">
> <exec dir="${vsshome}" executable="ss.exe" os="Windows 2000">
> <arg line=" get -i- -\"gl${jsphome}\" -r
${jspproject} -Y${vssuser},${vsspassword}"/>
> </exec>
> </target>
>
> I get:
> c:\sean\ant\nutrosant.xml:122: Whitespace required before attributes.
>
>
>
>
> --
> 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: How to put quotes inside the arg line for exec?

Posted by Diane Holt <ho...@yahoo.com>.
--- Sean LeBlanc <se...@nutros.com> wrote:
> I'm trying to get a task made that will get all files from
> Visual Source Safe.

Have you tried using <vssget>?  See:
  http://jakarta.apache.org/ant/manual/OptionalTasks/vss.html

[snip]
> Because jsphome property has spaces in it, I get:
> c:\sean\ant\nutrosant.xml:121: Execute failed: java.io.IOException:
> CreateProcess: ss.exe get -i- -glc:\Program Files\Apache Tomcat
> 4.0\webapps\Nutros\home -r
> $/MyProject/subproject/ -Yuser,pwd error=2

I don't think it's because of spaces in your directory -- "error=2"
usually means it didn't find the command in your PATH.

Diane

=====
(holtdl@yahoo.com)



__________________________________________________
Do You Yahoo!?
Yahoo! - Official partner of 2002 FIFA World Cup
http://fifaworldcup.yahoo.com

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