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:[EMAIL PROTECTED] 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: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]