expect telnet issue
Bill Campbell
linux-sxs at celestial.com
Mon Oct 15 11:49:28 PDT 2007
On Mon, Oct 15, 2007, Lonni J Friedman wrote:
>Greetings folks,
>I've got a few expect scripts that I'm trying to use to automate
>telnet logins on some remote power switches. The expect scripts work
>perfectly on their own, but I want/need to create a wrapper for them
>so that they're all unified through a single script. When I call the
>expect script via a wrapper bash script, it no longer works. I get as
>far as the "spawn telnet foo.com" command, and then it just stalls
>without ever sending the username/password jazz.
>
>I'm guessing that some kind of env variable isn't getting passed
>somewhere, but I can't figure out what.
>
>Anyone have any ideas on what might be going wrong?
I expect this has something to do with mapping of standard input
and standard output when run from a script.
I have used the perl expect modules for doing this sort of thing,
but it's been several years since I last tackled any of these.
Learning tcl might be another alternative.
Bill
--
INTERNET: bill at celestial.com Bill Campbell; Celestial Software LLC
URL: http://www.celestial.com/ PO Box 820; 6641 E. Mercer Way
FAX: (206) 232-9186 Mercer Island, WA 98040-0820; (206) 236-1676
Good luck to all you optimists out there who think Microsoft can deliver
35 million lines of quality code on which you can operate your business.
-- John C. Dvorak
More information about the Linux-users
mailing list