Local shell script need to be executed on a remote linux box

I need to execute a shell script on a remote linux box. But the shell script resides on the local linux box where I am currently logged in. Is there a way to do this? I know rsh <host> <command> can execute a command on the remote host.

When I am sorting a file I am getting a warning message
"Warning: A newline character was added to the end of file".

Please let me know hwy I am getting these warnings.

Thanks
Sumit

hi,

login as root on your local machine and copy the sh file to remote system using scp command and ssh to remote system and execute there.

sumitc,

Don't hijack anothers thread but start a new thread.

Thanks.

Is it interactive? does it require entering password?

I need to automate this - i.e., I need to write a script which does this (run the local script on the remote box) on may be 100 boxes one by one.

Rajesh,
Depends on what you really want to do? SSH is interactive, it's just like telnet, but secure.
You can ssh from your local Linux (or UNIX) to remote box and execute the script. Now, if you don't want to copy the script to the remote box, you can share a local directory using NFS (put your script in that dir). Then ssh to remote server, mount the NFS and execute the script. I think that is what you may be looking for. You can even automate all these steps too!

HTH,

Nitin :b:

I found that it can be done in 3 steps..

#1. remote copy your local script - this wont ask for password. i think you
# need to have same userid/passwd setup on the remote host
rcp yourscript.sh remote_hostname:/remote_path/yourscript.sh

#2. Execute the script on the remote box
rsh remote_host /remote_path/yourscript.sh

#3. Delete it
rsh remote_host rm /remote_path/yourscript.sh

Thanks for your responses...