home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #20 / NN_1992_20.iso / spool / comp / unix / shell / 3862 < prev    next >
Encoding:
Text File  |  1992-09-08  |  2.2 KB  |  64 lines

  1. Newsgroups: comp.unix.shell
  2. Path: sparky!uunet!spool.mu.edu!umn.edu!umeecs!nova!ellis
  3. From: ellis@nova.gmi.edu (Stew Ellis)
  4. Subject: Re: Automating telnet
  5. Message-ID: <ellis.716026723@nova>
  6. Keywords: telnet, here documents, automatic login
  7. Sender: news@zip.eecs.umich.edu (Mr. News)
  8. Organization: GMI Engineering&Management Institute, Flint, MI
  9. References: <ellis.715831025@nova>
  10. Date: Wed, 9 Sep 1992 08:18:43 GMT
  11. Lines: 51
  12.  
  13. ellis@nova.gmi.edu (Stew Ellis) (that's me) writes:
  14.  
  15. >I am trying to write a shell script to login to a remote gopher program.
  16. >The gopher program runs at login for user gopher, with no passwd.
  17.  
  18. >I have seen scripts before that automated ftp or telnet login, but I cannot
  19. >find them.
  20.  
  21. >I would have thought that telnet would read a here document in an orderly
  22. >fashion so something like the following would work:
  23. >  telnet remote.host << EOF
  24. >  loginname
  25. >  EOF
  26.  
  27. >The man page for telnet is of no help on this.  I am probably missing
  28. >something obvious to someone, but it is not obvious to me. :(
  29.  
  30. >Thank you for any help.
  31.  
  32.  
  33. [dup sig del]
  34.  
  35. A number of people wrote suggesting that I use expect.  I had already
  36. fetched expect for some other project in the past and had decided not to use
  37. it for that project because it also meant I would have to install tcl, which
  38. I am too busy to contemplate now.
  39.  
  40. Tom Chistians{e|o}n DID NOT write to suggest perl, which would probably have
  41. worked.
  42.  
  43. One kind soul pointed out that he thought here documents explicitly violated
  44. some of the RFC's for telnet, but that rlogin was less restrictive.  I have
  45. solved my problem with the following script (is this a one-liner or a
  46. two-liner), that logs me into the gopher client on the remote host.  I did
  47. not need any negotiation, so a here doc was not tried.
  48.  
  49.  
  50. #!/bin/sh
  51.  
  52. rlogin -l gopher remote.gopher.host
  53.  
  54.  
  55. Thank you to everyone, even if only one of you gave me the simplest
  56. solution. 
  57.  
  58.  
  59. --
  60. --                                                        ___________________
  61.   R.Stewart(Stew) Ellis, Assoc.Prof., (Off)313-762-9765  /   _____  ______ 
  62.   Humanities & Social Science,  GMI Eng.& Mgmt. Inst.   /        / /  /  / /
  63.   Flint, MI 48504      ellis@nova.gmi.edu              /________/ /  /  / /
  64.