ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Anderson, Rob (Global Trade)" <Rob.Ander...@nike.com>
Subject RE: rexec and setting env variables on remote host
Date Mon, 28 Jan 2008 21:44:06 GMT
You could also source the .profile in your ant script...

<rexec userid="${aname}"
           password="${apass}"
           server="${host}"
           command=". .profile ; cd ${i_dir}; echo $A_HOME $JDK_HOME" />

-Rob Anderson

-----Original Message-----
From: Steve Loughran [mailto:stevel@apache.org] 
Sent: Monday, January 28, 2008 2:40 AM
To: Ant Users List
Subject: Re: rexec and setting env variables on remote host

Z W wrote:
> Hi
> 
> I tried using rexec task to invoke a shell script.
> 
> <rexec userid="${aname}"
>            password="${apass}"
>            server="${host}"
>            command="cd ${i_dir}; echo $A_HOME $JDK_HOME" />
> 
> The output is as follows:
>     [rexec] /af/gord
>     [echo]
> 
> But when I check the local host of this unix box, the variables are
set in
> .profile. When echoed, they are displayed.
> 
> How do I make sure the shell sets these variables in Ant script using
rexec
> ? source command isn't available on the unix box.
> 

You've just dropped out of the ant world into the remote linux world.

* You only get stuff in .profile, .cshrc or whatever if you get  a login

prompt, and by default SSH prompts and other remote connections arent.

* I think its an SSH option to turn this back on. Otherwise run bash 
-login to run bash as a login


-- 
Steve Loughran                  http://www.1060.org/blogxter/publish/5
Author: Ant in Action           http://antbook.org/

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




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


Mime
View raw message