From: David J. <Dav...@Su...> - 2003-10-17 16:33:57
|
Ok I have written a perl script to interact with the user and ask for an ip address. Based on that ip my script calls a subroutine written in expect.pm to login to a server. Grand no problems. What I want to do now is hide the fact that expect is logged onto the server. I would like to return to a menu printed out using the perl "print" command. Then depending on what menu option the user selects another command could be sent-> to the server such as ls or cd Below is the telnet script I use.. sub telSession { my $session = Expect->spawn("telnet $localIP") || die "cannont spawn telnet\n"; $session->expect("username:"); $session->send("$myUname"); $session->expect("passsword:"); $session->send("$myPword"); $session->expect("prompt "); $session->interact; } |