*BSD News Article 52719


Return to BSD News archive

Path: euryale.cc.adfa.oz.au!newshost.anu.edu.au!harbinger.cc.monash.edu.au!yarrina.connect.com.au!classic.iinet.com.au!swing.iinet.net.au!news.uoregon.edu!chi-news.cic.net!simtel!news.kei.com!eff!news.umbc.edu!haven.umd.edu!cs.umd.edu!news.coop.net!hops.entertain.com!usenet
From: dwatson@abwam.com (Darryl Watson)
Newsgroups: comp.unix.bsd.bsdi.misc
Subject: Re: Trying to simulate a telnet session with PERL
Date: 15 Oct 1995 16:41:07 GMT
Organization: ABWAM, Inc.
Lines: 26
Message-ID: <45rdj3$s27@hops.entertain.com>
References: <45pcut$kcm@hops.entertain.com>
NNTP-Posting-Host: ppp008.entertain.com
X-Newsreader: WinVN 0.92.5

In article <45pcut$kcm@hops.entertain.com>, Darryl Watson <dwatson> says:
>
>..and having trouble.  I've got BSDi 2.0 with patches.
>
>I am trying to open a socket on port 23 of my system using
>PERL, but am not getting a login prompt in the resulting
>stream.  I would expect TELNETD to respond with a login,
>but it isn't happening.  Maybe I am specifying the wrong
>type of service?  When I go to other ports, such as daytime,
>this script works fine.
>
>When I do a telnet -d and 'set netdata', then 'open <hostname>',
>I see lots of telnet control data fly back and forth, just as
>specified in the RFCs listed in the TELNETD man page.

Etc.

I solved my own problem!

I went to our local bookstore, and while browsing the shelves, looking
for "Internetworking with TCP/IP Vol. III", I instead picked up the
book "Using Expect", and opened right to the page showing code doing
exactly what I was trying to do!

The answer is, use the right tool for the job.  Expect is what was
needed here.