Excellent clarifications gentleman, many thanks.  

You got me curious so I dug up a working example of quoting that I use.  

Try as I may, I can't seem to escape from the msdos command line processor.  
Bill's  enduring gift to humanity.

      <!-- Exec a command with spawn.  No return code checking possible. -->
      <macrodef name="execSpawnCmd">
         <attribute name="cmd"/>
         <attribute name="cmd.line" default=""/>
         <attribute name="dir" default=""/>
         <attribute name="logdir"/>
         <attribute name="logfile"/>
         <attribute name="callingTarget" default=""/>
       
         <sequential>
            <echo level="verbose" message="execSpawnCmd: cmd = @{cmd}"/>
            <echo level="verbose" message="execSpawnCmd: cmd.line = 
@{cmd.line}"/>
            <echo level="verbose" message="execSpawnCmd: dir = @{dir}"/>
            <echo level="verbose" message="execSpawnCmd: logdir = @{logdir}"/>
            <echo level="verbose" message="execSpawnCmd: logfile = @{logfile}"/>
            <echo level="verbose" message="execSpawnCmd: callingTarget = 
@{callingTarget}"/>


            <property name="logfile.fqp" location="@{logdir}/@{logfile}"/>
            <if><equals arg1="${os.localhost.type}" arg2="win"/><then>
               <exec executable="cmd" dir="@{dir}" spawn="true"> 
                  <arg value="/c"/>
                  <arg value="&quot;&quot;@{cmd}&quot; @{cmd.line} &gt; 
&quot;${logfile.fqp}&quot; 2&gt;&amp;1&quot;"/>
               </exec> 
            </then><elseif><equals arg1="${os.localhost.type}" 
arg2="unx"/><then>
               <exec executable="@{cmd}" dir="@{dir}" spawn="true">
                  <!-- this doesn't seem to work on unix after all
                  <arg value="@{cmd.line} &gt; ${logfile.fqp} 2&gt;&amp;1"/> -->
                  <arg value="@{cmd.line}"/>
               </exec> 
            </then></elseif></if>
          
         </sequential>
      </macrodef>

-----Original Message-----
From: Peter Reilly [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, July 18, 2007 12:06 PM
To: Ant Users List
Subject: Re: Execution of windows command in ant's build.xml

On 7/18/07, Jack J. Woehr <[EMAIL PROTECTED]> wrote:
>
> On Jul 18, 2007, at 9:55 AM, Peter Reilly wrote:
>
> >
> > Remember that a lot of directories have spaces in windows and this, 
> > combined with the multiple layers of quoting and interpretation 
> > (ant, Java, cmd and the other commands) mean that things may not 
> > work as expected.
>
> Entreprerneurial opportunity here for book, working title, 
> "Weirdnesses using open source software on Windows" :-)
That should be
"Weirdnesses using command line software on Windows"

Peter
>
>
> --
> Jack J. Woehr
> Director of Development
> Absolute Performance, Inc.
> [EMAIL PROTECTED]
> 303-443-7000 ext. 527
>
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: 
[EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to