ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefan Bodewig <bode...@apache.org>
Subject Re: quotes in args for exec
Date Tue, 30 Jul 2002 10:29:44 GMT
On Tue, 30 Jul 2002, Nathan Coast <nathan.coast@blueyonder.co.uk>
wrote:

> quotes only seem to be passed within arg elements if your arg
> contains a space 

...  or you use the value attribute instead of line - which I did in
my response.

[bodewig@bodewig tmp]$ cat quotes.xml 
<project default="test">
  <target name="test">
    <exec executable="ls">
      <arg value="-l" />
      <arg value='"foo"' />
    </exec>
  </target>

  <target name="test2">
    <exec executable="ls">
      <arg value="-l" />
      <arg line='"foo"' />
    </exec>
  </target>
</project>
[bodewig@bodewig tmp]$ ant -f quotes.xml -verbose
test:
     [exec] Current OS is Linux
     [exec] Executing 'ls' with arguments:
     [exec] '-l'
     [exec] '"foo"'
[bodewig@bodewig tmp]$ ant -f quotes.xml -verbose test2
test2:
     [exec] Current OS is Linux
     [exec] Executing 'ls' with arguments:
     [exec] '-l'
     [exec] 'foo'

Don't use line, never use line, unless you realy need the magic that's
lurking inside.

Stefan

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


Mime
View raw message