From: Juan P. F. G. <jfe...@gm...> - 2007-06-12 21:30:08
|
^^ > I suspect you need to send cu \r instead of \n. > > Austin Thanks for your answer Austin:... I had no luck sending \r :(.. here is the output: Code $rootexpect->exp_internal('2'); $rootexpect->expect($taim, "nnected"); $rootexpect->send("\r"); $rootexpect->send("AT\r"); $rootexpect->expect($taim,"OK"); my $x; $rootexpect->interact($x, 'XXX'); Output: Sending '\r' to spawn id(4) at /usr/share/perl5/Expect.pm line 1223 Expect::print('Expect=GLOB(0x8ab1888)', '\x{d}') called at ./getconfig.devel.pl line 541 main::connect2router() called at ./getconfig.devel.pl line 355 main::grabrouterdata() called at ./getconfig.devel.pl line 175 main::BUSCAROUTERS() called at ./getconfig.devel.pl line 190 Sending 'AT\r' to spawn id(4) at /usr/share/perl5/Expect.pm line 1223 Expect::print('Expect=GLOB(0x8ab1888)', 'AT\x{d}') called at ./getconfig.devel.pl line 544 main::connect2router() called at ./getconfig.devel.pl line 355 main::grabrouterdata() called at ./getconfig.devel.pl line 175 main::BUSCAROUTERS() called at ./getconfig.devel.pl line 190 Starting EXPECT pattern matching... at /usr/share/perl5/Expect.pm line 533 Expect::expect('Expect=GLOB(0x8ab1888)', 8, 'OK') called at ./getconfig.devel.pl line 546 main::connect2router() called at ./getconfig.devel.pl line 355 main::grabrouterdata() called at ./getconfig.devel.pl line 175 main::BUSCAROUTERS() called at ./getconfig.devel.pl line 190 spawn id(4): list of patterns: #1: -ex `OK' spawn id(4): Does `.\r\n' match: pattern #1: -ex `OK'? No. spawn id(4): Does `.\r\n\rAT\r' match: pattern #1: -ex `OK'? No. Thanks again... |