Dan Widyono on 7 Jun 2004 14:17:02 -0000


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: [PLUG] Bash script and telnet


Well, the "signal" is the final MUSH prompt.  That's what expect does: it
continuously regexp-matches the terminal's output and executes code based on
those matches.  It also logs and has other nice features.

The problem with writing expect from scratch (essentially) is that you have
to deal with the ugly scenarios yourself: interrupts, bad input, unexpected
closed sockets, error messages, alien conditions, etc. which the expect
maintainers have mostly coded already.

Just a simple "pull temperature info from TempTrax serial monitoring system"
was a headache to get right because of this.  It works by the user pressing
Return, and it spits out the temperature.  Stupid, I know, but it was a cheap
temperature probe which gave consistent clear-text ASCII human-readable
output.

My 2 cents, you might be a BASH programming wizard and want to go through the
pain :)

Dan W.

On Mon, Jun 07, 2004 at 06:41:14AM -0700, Matthew Ozor wrote:
> So there isn't a "signal" I could trap when Telnet is
> waiting for input?
> 
> 
> --- Jeff McAdams <jeffm@iglou.com> wrote:
> > Matthew Ozor wrote:
> > > Im writting a script to log into a MUSH through
> > > telnet. My question is that in the MUSH there is a
> > > long welcome screen before the login prompt. Is
> > there
> > > a way in BASH to to have it wait for the telnet
> > server
> > > to ask for an input? I want to send my login
> > > information with the script.

-- 
-- Daniel Widyono             --
-- www.widyono.net            --
-- www.cis.upenn.edu/~widyono --
-- 
___________________________________________________________________________
Philadelphia Linux Users Group         --        http://www.phillylinux.org
Announcements - http://lists.phillylinux.org/mailman/listinfo/plug-announce
General Discussion  --   http://lists.phillylinux.org/mailman/listinfo/plug