ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Albertus Vermeulen <Albert...@meb.co.za>
Subject RE: Environment variable before executable
Date Thu, 18 Oct 2001 09:24:40 GMT
Diane,

Thanks it works perfectly. Would you ever consider changing the <exec> task
to have something like a <commandprefix> attribute and then changing the
antRun script to also do "sh -c" rather than an "exec" ?

Albertus


-----Original Message-----
From: Diane Holt [mailto:holtdl@yahoo.com]
Sent: 17 October 2001 06:45
To: ant-user@jakarta.apache.org
Subject: Re: Environment variable before executable


--- Albertus Vermeulen <AlbertusV@meb.co.za> wrote:
> I would like to execute a system command, but I want to add an
> environment variable before the executable name (note it has to be in
> front of the executable). For example:
> 
> OSAGENT_PORT=20000 vbj myClass
> 
> I can't seem to find a way of using the exec task to achieve this.
> Making use of the <env> tag also does not solve my problem. Am I
> missing something in using the exec task ? Is there some other way
> for me to possibly achieve this ?

This works for me:
  <target name="foobar">
    <exec executable="sh">
      <arg line="-c 'FOOBAR=foobar ; echo $$FOOBAR'"/>
    </exec>
  </target>

Diane



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



__________________________________________________
Do You Yahoo!?
Make a great connection at Yahoo! Personals.
http://personals.yahoo.com

Mime
View raw message