From: Javier T. <Javier.Torres@INETATS.COM> - 2005-12-01 19:43:34
|
On cygwin you could run it because you have the IO::Stty and IO::Tty mods that can be installed. Where you can't run it is in windows with the Active State perl module since this does not allow for the IO modules to be installed. I have been using it in this context for over a year with 1.05, there were bugs fixed in the newer version so I bumped up. I will also try going back to the older version if I can find it out there on the net ;) =20 Javier _____ =20 From: Simon Taylor [mailto:se...@no...]=20 Sent: Thursday, December 01, 2005 2:35 PM To: Javier Torres; exp...@li... Subject: RE: [Expectperl-discuss] Spawn fails Have you had it running on cygwin before - i was under the impression your couldnt run expect.pm on windows because of the way it handled pty's. Might be wrong though. =20 _____ =20 From: exp...@li... [mailto:exp...@li...] On Behalf Of Javier Torres Sent: 01 December 2005 19:31 To: exp...@li... Subject: [Expectperl-discuss] Spawn fails Hello, I am running through the cygwin environment. I have the latest version of Expect.pm on my machine 1.15. =20 For some reason my scripts are no longer working when I upgraded to this version of the Expect.pm file. =20 My code used to be as follows: $Host_IP =3D "xx.xx.xx.xx"; my $timeout =3D 5; my $telnet_prompt =3D ">*"; my $ios_en_prompt =3D "#*"; my $command =3D "telnet $Host_IP"; my $exp =3D new Expect;=20 $exp =3D Expect->spawn($command) or die "could not spawn the telnet session to $Host_IP $!\n"; $exp->exp_internal(0); $exp->raw_pty(0); $exp->expect($timeout, ['timeout' , sub { print "timeout waiting for user prompt\n"; } ], [ qr/username:*/i, sub { my $self =3D shift; $self->send("jtorres\n"); exp_continue; } ], [ qr/password:*/i, sub { my $self =3D shift; $self->send("$password\r"); } ] ); This worked just fine, now after the upgrade to this latest version the spawn does not work, after reading on-line I tried running the following way: =20 $exp =3D Expect->spawn("telnet") or die "could not spawn the telnet session to $Host_IP $!\n"; $exp->exp_internal(1); $exp->raw_pty(1); $exp->expect($timeout, ['timeout' ,sub { print "timed out waiting for Windoze telnet prompt\n" } ], [ qr/$telnet_prompt/i , sub { my $self =3D shift; $self->send("open $Host_IP\n"); } ], ); $exp->expect($timeout, ['timeout' , sub { print "timeout waiting for user prompt\n"; } ], [ qr/username:*/i, sub { my $self =3D shift; $self->send("jtorres\n"); exp_continue; } ], [ qr/password:*/i, sub { my $self =3D shift; $self->send("$password\r"); } ] ); =20 I still am not able to run, not sure what else to try so I am wondering if anyone else has seen an issue like this. It seems as if the spawn command is not executing for me so it goes through the rest of the code but there is nothing there. Also if you need some debug info on how it is running just let me know and I can produce that. =20 Thanks, Javier F. Torres ***************************************************************** <<>> In compliance with applicable rules and regulations, Instinet reviews and archives incoming and outgoing email communications, copies of which may be produced at the request of regulators. This message is intended only for the personal and confidential use of the recipients named above. If the reader of this email is not the intended recipient, you have received this email in error and any review, dissemination, distribution or copying is strictly prohibited. If you have received this email in error, please notify the sender immediately by return email and permanently delete the copy you received.=20 Instinet accepts no liability for any content contained in the email, or any errors or omissions arising as a result of email transmission. Any opinions contained in this email constitute the sender's best judgment at this time and are subject to change without notice. Instinet does not make recommendations of a particular security and the information contained in this email should not be considered as a recommendation, an offer or a solicitation of an offer to buy and sell securities. ***************************************************************** |