The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #1 (permalink)  
Old 02-09-2009
amit1_x amit1_x is offline
Registered User
  
 

Join Date: Apr 2008
Posts: 23
changing shell while using ssh

Hello,

I am trying to ssh to a remote machine then change the shell and execute the script. However the ssh session hangs when i try to change the shell

Code:
ssh user@host 'csh ; source /home/cshProfile; $HOME/exec.sh'
if i do

Code:
ssh user@host  ' $HOME/exec.sh'
This works however i get errors as some of the env variables are in cshProfile file which is for cshell and the default shell of the remote user is ksh. so i have to first changet to csh on the remote machine, source the profile and execute the script.

Any advices?