LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   How to call Shell Script on a remote server with remote servers env variables (https://www.linuxquestions.org/questions/linux-server-73/how-to-call-shell-script-on-a-remote-server-with-remote-servers-env-variables-761932/)

need 10-14-2009 05:02 PM

How to call Shell Script on a remote server with remote servers env variables
 
Hello,

I need to call a shell script on the remote server which uses hadoop command. Now the remote server is a part of hadoop cluster and its environment is set up such that
"hadoop fs -ls" works on it.

But when I call a shell script from my own linux machine on this remote server that uses above command it fails saying hadoop command not found.

My question is : What do I need to do in order to call a script on the remote server in such way that it uses environmental variables from the remote server.

Currently, i use ssh <user>@remote <full path to shell script > to launch..
If there's any other way to call the shell script, please let me know

Thanks in advance!

chrism01 10-14-2009 08:37 PM

You need to source the login script eg ~/.bash_profile as part of the remote cmd.
Alternately, just write a brief script on the remote system that uses the full path and call that.


All times are GMT -5. The time now is 05:26 PM.