Francis thanks for your reply, but I'm not sure I follow why you think "echo $PATH" will not work. In fact it DOES work and it is not the problem. The problem in my example is the line before where I append the "/foo" to my path. The echo is just a way to show that my path was not altered with "/foo" at the beginning.
In fact my example does show "/foo" being appended to the path when I test it in fedora core 8 and 9 as well as Ubuntu and SuSE. Unfortunately something happened in Fedora Core 10 and 11. I appreciate any feedback. Thanks, Chris On Tue, Sep 1, 2009 at 7:40 AM, Francis GALIEGUE <[email protected]> wrote: > On Sun, Aug 23, 2009 at 21:14, chris chriss<[email protected]> > 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 > [email protected] > 40 avenue Raymond Poincaré > 75116 Paris > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [email protected] > For additional commands, e-mail: [email protected] > >
