Xref: utzoo comp.unix.admin:505 comp.unix.questions:26863 comp.unix.shell:885 Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!wuarchive!uunet!cme!libes From: libes@cme.nist.gov (Don Libes) Newsgroups: comp.unix.admin,comp.unix.questions,comp.unix.shell Subject: Re: telnet in a shell script Keywords: telnet Message-ID: <8026@muffin.cme.nist.gov> Date: 14 Nov 90 04:34:10 GMT References: <3886@male.EBay.Sun.COM> Organization: National Institute of Standards and Technology Lines: 18 In article <3886@male.EBay.Sun.COM> briantr@sunnet.EBay.Sun.COM (Brian Tran) writes: >I have a need to use the equivalence of the ".telnetrc" for use with >"telnet" in a C-shell program. How can I implement this so that >user doesn't not have to enter "username" and "password" when using >this little program? From your shell script, call an expect script like the following: spawn telnet male.ebay.sun.com expect "*login:*" send "brian\r" expect "*Password:" send "igiveup\r" interact The "interact" will let you use the telnet as if you had logged in yourself. Or you can do more send/expect statements.