Regarding changing shell thru script

Guys can I change the shell thru script, and after changing i want the script to continue on the previous machine.
Or please suggest other alternative if any???

#!/bin/ksh
HOST=`hostname`
echo "Running the script..."
for MyServer in `cat ServerNames.txt`
do
echo "\n Logging onto $MyServer"
ssh $MyServer -l Myname
ksh /tmp/Get_ParserInfo.ksh.ORG
echo " Script completed on $MyServer "
done

This doesn't work. Are you trying to say that when you log into machine X you want shell XS, but if you log into machine Y you want shell XY? Is the password/login information common to both machines? Will the administrator let you make very simple changes to the configuration of either host?

Thats the problem dude..... admin restrictions...
So what i did was...i used "here document" concept in the script

for MyServer in `cat ServerNames.txt`
do
echo "\n Logging onto $MyServer"
ssh $MyServer -l nyop <<EOT
ksh /tmp/Get_ParserInfo.ksh.ORG
EOT
echo " Script completed on $MyServer "
By this i was able to run the the script by logging onto other shell from my current shell
Hope dint confuse you!!!! :confused:

I'm sorry I dropped the ball on this one...

Again, are you saying you want to use a different shell for interactive use? Or do you want to launch a program for each of the servers in ServerNames.txt ?

The question here is , WHY you want to change the shell the script runs on? Maybe you mean "user" rather than "shell"?

Different shells have enough different syntax that could rend a script useless if run that script on a different shell it was written on. For example, a perfectly working ksh array will yield you errors on sh, csh, bash.