rlogin

I'm comparing a table from two databases on two different servers to check for equality.

  1. How do I use rlogin from a script , is it like this ?
    rlogin -l $username $server1

where $username and $server1 are passed from the command line.

2.create a copy of that table, compress it and ftp it to a temp directory, my main issue is the rlogin but is what I have done so far correct regarding the following:
(snippet of code)
gzip -c flatFile > flatFile.gz

ftp -n <<EOF
open $host
user
$user
$password
put flatFile.gz
quit
EOF 
  1. Then I want to close rlogin is that done like this: ~.

Thanks for any help at all in advance

Which platform you are using.?
You can use remsh / rexec (hp-ux) or rsh (linux/solaris) if you are having access for rlogin.

No need for ftp here. :wink:

Sun OS 5.9

Ok,

on the command line I have the user entering :

-server -username -password

then in the script I have :

rlogin -l username host

but then I'm prompted for a password, any idea how I can redirect the password from the command line , and enter that when I'm prompted for it.

Please any ideas,

if I should use rsh,telnet,ssh tell me as well.

There is no way to redirect password directly. You should use expect if you want to supply passwords to any script.

If you want to use rlogin, you will have to use .rhosts and add the entry for your system in that file. Alternatively you could use ssh and setup key-based authentication.