Automating Rlogin and File Retrieving

Hi,
I'm a begginer in Unix Scripting and i'm trying to write a script that performs this functions..

  1. Rlogin to a system
  2. Copy a Perl script inTO the system
  3. Run the Perl Script
  4. Retrieve the result(file) of the Perl Script
  5. Copy the result file to a single system
  6. Logout of the system

This process is repeated to 10 systems. This script is moreless a data extraction script.

Your help is greatly appreciated..
Thank you

Here's a sample script that you can run on the central system where the output will be stored:

#!/bin/sh
rcp <path of perl script> <remote system>:<dest path of script>
rsh <remote system> -n -l <username on dest system> <remote path of script>
rcp <remote system>:<remote path of output of script> <local path of output>

You can put this in a for loop if running for more than one system.

Thanks a lot!! :smiley:
The file copying command works fine but when the script is executed an error occurs. It says "Could not open file". But when I rlogin to the remote system and execute the script manually there is no error and the script runs smoothly. :confused:

The script is supposed to open certain files w/in a directory in the remote system.

Please advise, thanks..

slight change ... the remote script transfer maybe getting the execute bit unset based on the umask value for the user at the remote server ...

#!/bin/sh
rcp -p  <path of perl script> <remote system>:<dest path of script>
rsh <remote system> -n -l <username on dest system> <remote path of script>
rcp -p  <remote system>:<remote path of output of script> <local path of output>