[comp.protocols.tcp-ip] rlogin and run a command etc

nigel@cnw01.storesys.coles.oz.au (Nigel Harwood) (12/02/90)

Apologies if this is a FAQ but I have up till now not read
this news group (I did read all postings not yet expired).

I have two systems connected via Win TCP/IP Ethernet.

One system is to be used by the users to run all their jobs
irregardless of which machine the job runs on.

I cannot use the remote shell as some of the jobs they run
are COBOL programs which use cursor addressing etc.

Rlogin seemed to be promising as it can be auto-login with
Win TCP/IP.

The problem was that I cannot tell it to run a command as soon as
it has logged in.

Someone pointed out that the TERM variable was exported (nothing
else from the environment sadly).

By a slight fudge I could use TERM and the .login to do the job
but is there a better way ?

I have toyed with getting the source to rlogin but I'd rather not.

Regards
-- 
<<<<<<<<<<<<<<<<<<<<<<<<<  Nigel Harwood  >>>>>>>>>>>>>>>>>>>>>>>>>>>
<< Post:  Coles Myer Ltd, PO Box 2000 Tooronga 3146, Australia     >>
<< Phone: +61 3 829 6090  E-mail: nigel@cnw01.storesys.coles.oz.au >>
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

libes@cme.nist.gov (Don Libes) (12/04/90)

In article <1141@cnw01.storesys.coles.oz.au> nigel@cnw01.storesys.coles.oz.au (Nigel Harwood) writes:
>[Neither rsh nor rlogin does what I want - to run a command, possibly
>with cursor addressing, as soon as it has logged in, all non-interactively]

Get 'expect'.  It follows a script to talk to interactive programs
like rlogin, telnet, tip, etc.  The scripting language is quite general.

We use it like crazy here to automate a lot of stupid programs with
interactive-only interfaces.  We've even have scripts that control our
VMS computers from UNIX.  For example, I can set my password on our
UNIX boxes and have it automatically change passwords on our VMS
machines.  It's good for regression testing interactive software, too,
not to mention controlling our network boxes.

expect can be ftp'd as pub/expect.shar.Z from durer.cme.nist.gov.
Request email delivery by mailing to "library@cme.nist.gov".  The
contents of the message should be (no subject line) "send
pub/expect.shar.Z".

Don Libes          libes@cme.nist.gov      ...!uunet!cme-durer!libes

gary@sci34hub.UUCP (Gary Heston) (12/07/90)

In article <1141@cnw01.storesys.coles.oz.au> nigel@cnw01.storesys.coles.oz.au (Nigel Harwood) writes:
> [ using rlogin ]
>The problem was that I cannot tell it to run a command as soon as
>it has logged in.

Change the userid entry in /etc/passwd so that it runs the command (your
COBOL menu, in this case) upon login instead of /bin/sh (or whichever).

For an example, look at the entry for nuucp--it automatically runs 
/usr/lib/uucico (unless someone's removed it for security reasons).

-- 
Gary Heston System Mismanager and technoflunky uunet!sci34hub!gary or
My opinions, not theirs.  SCI Systems, Inc.     gary@sci34hub.sci.com
  The sysadmin sees all, knows all, and doesn't tell the boss who's
  updating their resumes....  This .sig Copyright G. L. Heston, 1990