telnet in a shell script

Don Libes libes at cme.nist.gov
Wed Nov 14 15:34:10 AEST 1990


In article <3886 at male.EBay.Sun.COM> briantr at 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.



More information about the Comp.unix.questions mailing list