On Sun, Aug 23, 2009 at 21:14, chris chriss<mr.monkey9...@gmail.com> wrote:
> I'm trying to append something to the PATH env variable in fedora 10 and
> fedora 11. It doesn't seem to work. (Fedora 8 and 9 work as expected, as
> well as ubuntu with the same versions of ant 1.7.1). My example below should
> echo out the path with "/foo" at the begining.  I don't believe it's a bug
> with the version of ant, but how it's interacting with the FC10 and FC11
> environment.   Not sure how to track this down.  Any help is greatly
> appreciated.
>
> Chris
>
> <project name="test env" default="test" basedir=".">
>  <property environment="env"/>
>
>  <target name="test">
>   <echo> env.PATH=${env.PATH} </echo>
>   <exec dir="/" executable="bash" os="Linux" failonerror="true"
> searchpath="true">
>     <arg value="--login" />
>     <arg value="-c"      />
>     <env key="PATH" value="/foo:${env.PATH}"/>
>     <arg value="echo $PATH" />
>   </exec>
>  </target>
> </project>
>

You have two misunderstandings here:

1. as to <arg value="something"/>: this will bundle what is in value
in only one argument to the command line. Writing ls -l is not the
same AT ALL than writing "ls -l" (in the second case, bash will answer
that the "ls -l" command does not exist" ;
2. the environment variables are evaluated by the shell, ant WILL NOT
evaluate them. <arg value="$PATH"/> will send a literal $PATH as an
argument. $PATH will NOT be interpolated by ant at all.

The only means of doing what you want is to write a shell script to
echo the value of the PATH environment variable.

-- 

Francis Galiegue
ONE2TEAM
Ingénieur système
Mob : +33 (0) 683 877 875
Tel : +33 (0) 178 945 552
f...@one2team.com
40 avenue Raymond Poincaré
75116 Paris

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

Reply via email to