home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.unix.misc
- Path: sparky!uunet!zaphod.mps.ohio-state.edu!cs.utexas.edu!uwm.edu!spool.mu.edu!agate!stanford.edu!rock!concert!sas!mozart.unx.sas.com!sasmob
- From: sasmob@chewy.unx.sas.com (Mark Burhans)
- Subject: Re: How to automate Telnet sessions?
- Originator: sasmob@chewy.unx.sas.com
- Sender: news@unx.sas.com (Noter of Newsworthy Events)
- Message-ID: <BzDJwD.8Fx@unx.sas.com>
- Date: Wed, 16 Dec 1992 23:00:12 GMT
- Distribution: na
- References: <104398@bu.edu>
- Nntp-Posting-Host: chewy.unx.sas.com
- Organization: SAS Institute Inc.
- Lines: 48
-
-
- In article <104398@bu.edu>, apollo@buengc.bu.edu (Doug A. Chan) writes:
- |> Is there a simple way to automate a telnet session?
- |> By this I mean I'd like to do something like:
- |>
- |> csh% telnet < scriptfile >& logoutput
- |>
- |> Where 'scriptfile' could contain:
- |> open bigpc [command to telnet's cli]
- |> joebob [assuming username next]
- |> mypassword [user's password]
- |> vt100 [terminal type]
- |> ls -al [something to do when logged in...]
- |> logout [exit]
- |>
-
- This seems to work over here:
-
- ------cut here-------------
- #!/bin/csh
- echo "" # Our VM prompts for the user to press <ENTER> to begin
- sleep 2 # Oh, just various delays so system isn't overrun
- echo logon joebob # VM needs the command LOGON plus the USERID
- sleep 2 # delay
- echo joebobpasswd1 # Send over this topsecret password
- sleep 5 # Boot baby!!! Come on, you can do it! :-)
- echo listfile # Command(s) go here
- sleep 2 # dillydally
- echo logoff # Outa here
- ------cut here-------------
-
- Let's say that was named: "VMlist.csh". Make it an executable, and
- type:
-
- VMlist.csh | telnet vm >VMlist.log
-
- I get a nice log of how the VM session went in VMlist.log. I guess
- you'll want to do manual telnets so you'll know what to each script
- needs and guestimating delays or see if you can ignore timing... that's
- what I do... maybe it will go away... :-)
-
- Anyways....
-
-
- --
- ---Mark C. Burhans---sasmob@chewy.unx.sas.com---919/677-8001 ext 7324
- SAS Institute, Inc., USA, SAS Campus Drive, Cary, NC 27513.
- "Polygamy: One wife too many. Monogamy: Same idea." --Unknown???
-