scripting a curses app

  • Thread starter Zebee Johnstone
  • Start date
Z

Zebee Johnstone

we have some hardware boxes that are configured via telnet into a curses
based app.

Is there a perl module that can script input to curses applications?

All the stuff in CPAN that comes up when searching for curses is how to
write apps using it, not how to speak to apps using it.

Will Expect handle this?

Zebee
 
P

Peter Corlett

Zebee Johnstone said:
we have some hardware boxes that are configured via telnet into a
curses based app. Is there a perl module that can script input to
curses applications?

google:screen+scrape+cpan.org suggests not. It's all geared to
screen-scraping websites these days.

[...]
Will Expect handle this?

I have used Expect to script a specific curses-based application, but
that had a fairly crude display update mechanism, and wasn't
mission-critical enough that I got away with it screwing up all the
time. However, Expect is unlikely to work too well for the general
case of all curses apps.

You may find that the device doesn't actually use curses and is
sufficiently inefficient in its screen updates that there are enough
tokens for you to expect.

I have a very old C program I wrote at
http://www.cabal.org.uk/freeware/misc/snoopio.html which you may be
able to tee into the connection to log what's actually going over the
wire in an interactive session to see if unleashing Expect on it is
likely to be fruitful.

If you find you have to do it the hard way by rendering to a virtual
frame buffer and plucking data from that, Term::VT102 looks like a
very good start, and I suspect its author had pretty much the same
problem as you.
 
Z

Zebee Johnstone

In comp.lang.perl.misc on 03 Mar 2005 10:04:16 GMT
Peter Corlett said:
You may find that the device doesn't actually use curses and is
sufficiently inefficient in its screen updates that there are enough
tokens for you to expect.

Hmm.. could be. I'll borrow your prog and see what I can find.

Zebee
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,982
Messages
2,570,190
Members
46,740
Latest member
AdolphBig6

Latest Threads

Top