jrock70 has asked for the wisdom of the Perl Monks concerning the following question:

I am working on an existing Perl script that used Telnet & Expect to start an application and then navigate through a series of menus. I need to modify this app to access a new server via SSH and am trying to use SSH:Expect. However, when I Send() or Exec() the command to start the application, waitfor does not appear to 'see' the menus. Is there a better way to accomplish this? Additional information: I am able to connect, run commands like “ls” and get results but cannot seem to navigate through the menus.
$t->waitfor('199',5) or print "Prompt not found"; $t->send("startapp"); #start application $t->waitfor('MENU1',5) or print "MENU1 not found"; $t->send("a");

Replies are listed 'Best First'.
Re: SSH Expect running apps
by zwon (Abbot) on May 12, 2010 at 21:48 UTC

    Have you read "IMPORTANT NOTES ABOUT DEALING WITH SSH AND PSEUDO-TERMINALS" section from Net::SSH::Expect documentation?