home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.unix.shell
- Path: sparky!uunet!spool.mu.edu!umn.edu!umeecs!nova!ellis
- From: ellis@nova.gmi.edu (Stew Ellis)
- Subject: Re: Automating telnet
- Message-ID: <ellis.716026723@nova>
- Keywords: telnet, here documents, automatic login
- Sender: news@zip.eecs.umich.edu (Mr. News)
- Organization: GMI Engineering&Management Institute, Flint, MI
- References: <ellis.715831025@nova>
- Date: Wed, 9 Sep 1992 08:18:43 GMT
- Lines: 51
-
- ellis@nova.gmi.edu (Stew Ellis) (that's me) writes:
-
- >I am trying to write a shell script to login to a remote gopher program.
- >The gopher program runs at login for user gopher, with no passwd.
-
- >I have seen scripts before that automated ftp or telnet login, but I cannot
- >find them.
-
- >I would have thought that telnet would read a here document in an orderly
- >fashion so something like the following would work:
- > telnet remote.host << EOF
- > loginname
- > EOF
-
- >The man page for telnet is of no help on this. I am probably missing
- >something obvious to someone, but it is not obvious to me. :(
-
- >Thank you for any help.
-
-
- [dup sig del]
-
- A number of people wrote suggesting that I use expect. I had already
- fetched expect for some other project in the past and had decided not to use
- it for that project because it also meant I would have to install tcl, which
- I am too busy to contemplate now.
-
- Tom Chistians{e|o}n DID NOT write to suggest perl, which would probably have
- worked.
-
- One kind soul pointed out that he thought here documents explicitly violated
- some of the RFC's for telnet, but that rlogin was less restrictive. I have
- solved my problem with the following script (is this a one-liner or a
- two-liner), that logs me into the gopher client on the remote host. I did
- not need any negotiation, so a here doc was not tried.
-
-
- #!/bin/sh
-
- rlogin -l gopher remote.gopher.host
-
-
- Thank you to everyone, even if only one of you gave me the simplest
- solution.
-
-
- --
- -- ___________________
- R.Stewart(Stew) Ellis, Assoc.Prof., (Off)313-762-9765 / _____ ______
- Humanities & Social Science, GMI Eng.& Mgmt. Inst. / / / / / /
- Flint, MI 48504 ellis@nova.gmi.edu /________/ / / / /
-