You can subscribe to this list here.
2000 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(1) |
Sep
(1) |
Oct
(1) |
Nov
(26) |
Dec
(7) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2001 |
Jan
(5) |
Feb
(3) |
Mar
(11) |
Apr
(10) |
May
(2) |
Jun
(5) |
Jul
(13) |
Aug
(2) |
Sep
(3) |
Oct
(10) |
Nov
(18) |
Dec
(29) |
2002 |
Jan
(12) |
Feb
(14) |
Mar
(73) |
Apr
(28) |
May
(21) |
Jun
(39) |
Jul
(40) |
Aug
(42) |
Sep
(20) |
Oct
(4) |
Nov
(9) |
Dec
(18) |
2003 |
Jan
(2) |
Feb
(8) |
Mar
(6) |
Apr
(24) |
May
(24) |
Jun
(14) |
Jul
(16) |
Aug
(36) |
Sep
(34) |
Oct
(23) |
Nov
(4) |
Dec
(15) |
2004 |
Jan
(6) |
Feb
(13) |
Mar
(7) |
Apr
(5) |
May
(11) |
Jun
(5) |
Jul
(4) |
Aug
|
Sep
(2) |
Oct
(16) |
Nov
(4) |
Dec
(9) |
2005 |
Jan
(2) |
Feb
(1) |
Mar
(3) |
Apr
(10) |
May
(5) |
Jun
(13) |
Jul
(3) |
Aug
|
Sep
(7) |
Oct
(5) |
Nov
(1) |
Dec
(9) |
2006 |
Jan
|
Feb
(10) |
Mar
(22) |
Apr
(14) |
May
(5) |
Jun
(4) |
Jul
(19) |
Aug
(7) |
Sep
(16) |
Oct
(4) |
Nov
(1) |
Dec
(16) |
2007 |
Jan
(17) |
Feb
|
Mar
(35) |
Apr
(5) |
May
(20) |
Jun
(11) |
Jul
(33) |
Aug
(3) |
Sep
(2) |
Oct
(11) |
Nov
(23) |
Dec
(5) |
2008 |
Jan
(10) |
Feb
(9) |
Mar
|
Apr
(6) |
May
(8) |
Jun
(7) |
Jul
|
Aug
(3) |
Sep
(2) |
Oct
(1) |
Nov
|
Dec
(20) |
2009 |
Jan
(8) |
Feb
(8) |
Mar
(3) |
Apr
(8) |
May
(2) |
Jun
(11) |
Jul
(2) |
Aug
|
Sep
(3) |
Oct
(1) |
Nov
(7) |
Dec
(4) |
2010 |
Jan
(2) |
Feb
(1) |
Mar
(3) |
Apr
|
May
(2) |
Jun
(2) |
Jul
(7) |
Aug
(3) |
Sep
(7) |
Oct
(2) |
Nov
(1) |
Dec
(4) |
2011 |
Jan
(4) |
Feb
(5) |
Mar
|
Apr
(3) |
May
(2) |
Jun
|
Jul
(6) |
Aug
|
Sep
|
Oct
(6) |
Nov
|
Dec
|
2012 |
Jan
|
Feb
(1) |
Mar
|
Apr
(3) |
May
|
Jun
|
Jul
(2) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2013 |
Jan
|
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
(5) |
Oct
|
Nov
|
Dec
|
2014 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(2) |
Aug
(7) |
Sep
(2) |
Oct
|
Nov
|
Dec
|
2015 |
Jan
|
Feb
|
Mar
(30) |
Apr
(10) |
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2017 |
Jan
|
Feb
|
Mar
(12) |
Apr
|
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(1) |
Dec
(1) |
2018 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(2) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2022 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(1) |
Dec
|
2024 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(1) |
From: Matt Z. <mzagrabe@d.umn.edu> - 2007-07-11 19:29:16
|
On Wed, 2007-07-11 at 11:56 -0700, Austin Schutz wrote: > On Wed, Jul 11, 2007 at 10:50:32AM -0500, Matt Zagrabelny wrote: > > [...] > >=20 > > > Does anybody knows why I'm getting this strange behavior ? > >=20 > > Check the archives. > >=20 > > From [1] comes: > >=20 > > >> > > While Expect is supposed to be reasonably threadsafe, IO-Tty is *not*, > > that's where the problems come from. If you want to automate telnet, > > using Net::Telnet with Expect should be possible under threads. > > << > >=20 > > I have had issues getting expect to use a spawned Net::Telnet object as > > well (which is "supposed to be" thread safe). After much gnashing of > > teeth, i have given up on Expect and been using Net::Telnet alone; whic= h > > is disappointing, because Expect is much more powerful and elegant than > > Net::Telnet, however many *many* hours were wasted trying to get them t= o > > work together across a diverse population of Cisco gear. > >=20 >=20 > Have you tried using exp_init on a Net::Telnet object? That doesn't > use IO::Tty. Yes, and by in large it worked. However, there were some Cisco switches that it did not work for. So... I emailed the list and a fellow gave me some good advice and my problems were solved, so I thought. There were still some anomalies that were not working correctly. So to recap: * Expect worked with everything, but no threads * Expect with Net::Telnet was threaded, but could not communicate to all switches * Expect with Net::Telnet plus trick from mailing list was able to communicate to almost all switches, but not all Hence... I now use Net::Telnet by itself. It is not as elegant as Expect, but the thread speedup is *awesome*. --=20 Matt Zagrabelny - mzagrabe@d.umn.edu - (218) 726 8844 University of Minnesota Duluth Information Technology Systems & Services PGP key 1024D/84E22DA2 2005-11-07 Fingerprint: 78F9 18B3 EF58 56F5 FC85 C5CA 53E7 887F 84E2 2DA2 He is not a fool who gives up what he cannot keep to gain what he cannot lose. -Jim Elliot |
From: Austin S. <te...@of...> - 2007-07-11 19:01:55
|
On Wed, Jul 11, 2007 at 10:50:32AM -0500, Matt Zagrabelny wrote: > [...] > > > Does anybody knows why I'm getting this strange behavior ? > > Check the archives. > > From [1] comes: > > >> > While Expect is supposed to be reasonably threadsafe, IO-Tty is *not*, > that's where the problems come from. If you want to automate telnet, > using Net::Telnet with Expect should be possible under threads. > << > > I have had issues getting expect to use a spawned Net::Telnet object as > well (which is "supposed to be" thread safe). After much gnashing of > teeth, i have given up on Expect and been using Net::Telnet alone; which > is disappointing, because Expect is much more powerful and elegant than > Net::Telnet, however many *many* hours were wasted trying to get them to > work together across a diverse population of Cisco gear. > Have you tried using exp_init on a Net::Telnet object? That doesn't use IO::Tty. Austin |
From: Matt Z. <mzagrabe@d.umn.edu> - 2007-07-11 16:45:18
|
[...] > Does anybody knows why I'm getting this strange behavior ? Check the archives. =46rom [1] comes: >> While Expect is supposed to be reasonably threadsafe, IO-Tty is *not*, that's where the problems come from. If you want to automate telnet, using Net::Telnet with Expect should be possible under threads. << I have had issues getting expect to use a spawned Net::Telnet object as well (which is "supposed to be" thread safe). After much gnashing of teeth, i have given up on Expect and been using Net::Telnet alone; which is disappointing, because Expect is much more powerful and elegant than Net::Telnet, however many *many* hours were wasted trying to get them to work together across a diverse population of Cisco gear. [1] http://sourceforge.net/mailarchive/message.php?msg_id=3D3DE0EEDC.7060703% 40cpan.org --=20 Matt Zagrabelny - mzagrabe@d.umn.edu - (218) 726 8844 University of Minnesota Duluth Information Technology Systems & Services PGP key 1024D/84E22DA2 2005-11-07 Fingerprint: 78F9 18B3 EF58 56F5 FC85 C5CA 53E7 887F 84E2 2DA2 He is not a fool who gives up what he cannot keep to gain what he cannot lose. -Jim Elliot |
From: schlum <jsc...@bo...> - 2007-07-11 14:19:52
|
Hi, I spent few days on this one, but couldn't get it working... I am working under sunOS bt1wxxxx#uname -a SunOS bt1wxxxx 5.6 Generic_105181-23 sun4u sparc SUNW,Ultra-60 I can run the following script without any problem : #!/usr/bin/perl use strict; use Expect; my $exp = Expect->new; $exp->raw_pty(1); my $test = $exp->spawn('/usr/local/bin/ssh', -l => 'my_user', 'my_host') or die "Cannot spawn command: $!\n"; my @test1 = $exp->expect(5,'-re','password:'); $exp->clear_accum(); my @test2 = $exp->send("my_pass\r\n"); my @test3 = $exp->expect(15,'-re','my_host'); my @test4 = $exp->send("sh privilege\r\n"); The last command is exectuted successfuly. But if I try this : #!/usr/bin/perl use strict; use Expect; use threads; use threads::shared; use Thread::Queue::Any; my $thread = threads->new(\&threadJob,); $thread->join; sub threadJob{ my $exp = Expect->new; $exp->raw_pty(1); my $test = $exp->spawn('/usr/local/bin/ssh', -l => 'my_user', 'my_host') or die "Cannot spawn command: $!\n"; my @test1 = $exp->expect(5,'-re','password:'); $exp->clear_accum(); my @test2 = $exp->send("my_pass\r\n"); my @test3 = $exp->expect(15,'-re','my_host'); my @test4 = $exp->send("sh privilege\r\n");# On envoie le mdp } I actually get connected, but Expect don't interact anymore with ssh after the logging. Instead, I can access the box, I telneted from STDIN ... Does anybody knows why I'm getting this strange behavior ? Btw, when I close the conection, the script finishes to run peacefully. -- View this message in context: http://www.nabble.com/Trouble-with-Expect-working-with-Threads-tf4062209.html#a11541250 Sent from the Perl - Expectperl-Discuss mailing list archive at Nabble.com. |
From: Sherry L. <she...@ya...> - 2007-07-09 23:11:32
|
Hi, When I try to run a test script under windows cygwin environment, I got the following error: $ ./t193.pl Can't load '/usr/bin/Tty' for module IO::Tty: No such file or directory at /usr/lib/perl5/5.8/cygwin /DynaLoader.pm line 230. at /usr/lib/perl5/5.8/IO/Tty.pm line 30 Compilation failed in require at /usr/lib/perl5/5.8/IO/Pty.pm line 7. BEGIN failed--compilation aborted at /usr/lib/perl5/5.8/IO/Pty.pm line 7. Compilation failed in require at /usr/lib/perl5/5.8/Expect.pm line 22. BEGIN failed--compilation aborted at /usr/lib/perl5/5.8/Expect.pm line 22. Compilation failed in require at ./t193.pl line 8. BEGIN failed--compilation aborted at ./t193.pl line 8. I check under /usr/bin and there is a tty.exe file: $ ls /usr/bin/tty.exe /usr/bin/tty.exe Any help is appreciated. Sherry --------------------------------- Looking for a deal? Find great prices on flights and hotels with Yahoo! FareChase. |
From: titetluc t. <tit...@gm...> - 2007-07-09 11:12:10
|
Hi all, I encoutered a problem using Expect version 1.20 but did not find any information in the mailing list The following code should display "failed" (the password is incorrect and Net::SSH::Expect::connect method raised an exception) but displays "succeeded" ################################ use strict; use Net::SSH::Expect; sub test { my $ssh; $ssh = Net::SSH::Expect->new(host => 'my_machine', prompt => 'my_prompt', password => 'wrong_password', user => 'titouan', timeout => 4); $ssh->connect(); } eval { test(); }; if ($@){ print "failed\n"; } else { print "succeeded\n"; } ################################ If I modify the code (by declaring the $ssh variable out of the test function), the code displays failed ################################ use strict; use Net::SSH::Expect; my $ssh; sub test { $ssh = Net::SSH::Expect->new(host => 'my_machine', prompt => 'my_prompt', password => 'wrong_password', user => 'titouan', timeout => 4); $ssh->connect(); } eval { test(); }; if ($@){ print "failed\n"; } else { print "succeeded\n"; } ################################ I tried to understand what happened in the first case If I use the debugger, the $@ is correctly set with the Net::SSH::Expect module, but when ssh variable is out of scope, the perl interpeter call the Expect::DESTROY function. This last function undef $@ (when calling $self->hard_close()) Is this a bug in Expect module ? How can I prevent this behavior ? Thanks |
From: markgo <gol...@gm...> - 2007-07-06 19:02:18
|
Austin Schutz wrote: > >> This is a tool I'd like to interrupt. >> >> $session->send("\cC") does not work, I suppose because the tool is not >> waiting for input. >> > > It should work anyway unless you have tweaked your term settings > interrupt character. $session->slave->stty('intr', "\cC") should do it. > > > Austin > Thanks for advice, I'll try to understand it better (it di dnot work as I expected). Actually, Ken's suggestion solved my problem. -- View this message in context: http://www.nabble.com/Is-it-possible-to-interrupt-spawned-session-%28like-Ctrl-C%29-tf4028111.html#a11470791 Sent from the Perl - Expectperl-Discuss mailing list archive at Nabble.com. |
From: markgo <gol...@gm...> - 2007-07-06 18:59:17
|
Bruno Negrao-3 wrote: > > Why don't you add a signal handler to your perl script that when it > receives the CTRL-C > it calls the > > $exp->hard_close(); > > on the spawned expect object? > > regards, > > bruno > > Thanks for your response, but the situation is a bit different. I'm testing someone's tool. I can't modify it. I actually need to kill some of its sub-processes. Ken's suggestion works fine. -- View this message in context: http://www.nabble.com/Is-it-possible-to-interrupt-spawned-session-%28like-Ctrl-C%29-tf4028111.html#a11470788 Sent from the Perl - Expectperl-Discuss mailing list archive at Nabble.com. |
From: markgo <gol...@gm...> - 2007-07-06 18:55:20
|
Ken Irving wrote: > > On Thu, Jul 05, 2007 at 12:26:20AM -0700, markgo wrote: >> >> Hi, >> >> In some script I'm sending the command that runs some tool that could >> only >> be stopped by pressing Ctrl-C. It does not wait for any input. Is there >> any >> way to simulate this Ctrl-C (that is SIGINT) except closing the session? > Why not just send the signal directly to the process: > > kill SIGINT $tool_pid; > > Ken > > Indeed! Silly me. The tool printed out "press Ctrl-C" and I tried to send Ctrl-C. Thank you Ken, of course it works that way. -- View this message in context: http://www.nabble.com/Is-it-possible-to-interrupt-spawned-session-%28like-Ctrl-C%29-tf4028111.html#a11470738 Sent from the Perl - Expectperl-Discuss mailing list archive at Nabble.com. |
From: Austin S. <te...@of...> - 2007-07-06 17:16:03
|
> This is a tool I'd like to interrupt. > > $session->send("\cC") does not work, I suppose because the tool is not > waiting for input. > It should work anyway unless you have tweaked your term settings interrupt character. $session->slave->stty('intr', "\cC") should do it. Austin |
From: Ken I. <fn...@ua...> - 2007-07-06 15:07:48
|
On Fri, Jul 06, 2007 at 04:48:48PM +0530, Prasad Joshi wrote: > Hi All, > > This is the string I am passing to the expect > "Do you want to uninstall depot \w+ from \w+ which is dependent" > > But, I am not getting why it is failling to match following line which > is printed on the terminal. > "Do you want to uninstall depot VRTSvxfs from slpam09 which is dependent" > > Basically, If I remove the regular expression strings from the inputed > string to expect ie. remove \w+ with the exact word, then it is working > fine. I am not getting what I have done wrong. > > Please help. > > <<<<<<<<<<<<<<<< PART OF THE CODE <<<<<<<<< > push (@match_patterns, "Do you want to uninstall depot \w+ from \w+ > which is dependent" ) ; > $functions[$#functions+1] = \&send_yes ; > > my $expect = $cluster->getExpect ($hosts[0]); ##### this > returns an expect object > $expect->expect($timeout, '-re', "MyPrompt>"); > > #### THIS IS A CALL TO EXPECT. > my ( $matched_pattern_pos, $error, $matched_str, $before_match, > $after_match) = $expect->expect( $timeout, '-re', @match_patterns ) ; > <<<<<<<<<<<<<<<< > > I am not able to use regular expression in the expect string. Please help. > > Thanks and Regards, > Prasad. Besides the quoting issue already mentioned, it's not clear from your code that the '-re' precedes the match pattern you're describing; maybe you've already pushed some entries into @match_patterns? This may be different in older versions of Expect, but at least as of v1.15 the '-re' argument applies only to the next string/pattern argument in the list. Ken -- Ken Irving, fn...@ua... |
From: Bruno N. <bn...@gm...> - 2007-07-06 14:59:38
|
Why don't you add a signal handler to your perl script that when it receives the CTRL-C it calls the $exp->hard_close(); on the spawned expect object? regards, bruno On 7/6/07, Ken Irving <fn...@ua...> wrote: > On Thu, Jul 05, 2007 at 12:26:20AM -0700, markgo wrote: > > > > Hi, > > > > In some script I'm sending the command that runs some tool that could only > > be stopped by pressing Ctrl-C. It does not wait for any input. Is there any > > way to simulate this Ctrl-C (that is SIGINT) except closing the session? > > > > Currently it looks like that: > > > > $session = new Expect; > > $session->spawn("su - $user_name") or die "..."; # Script runs as root > > $session->expect(....); > > ... > > > > $session->send("sudo $tool"); > > > > ... > > > > This is a tool I'd like to interrupt. > > > > $session->send("\cC") does not work, I suppose because the tool is not > > waiting for input. > > > > Thank you, > > Mark > > Why not just send the signal directly to the process: > > kill SIGINT $tool_pid; > > Ken > > -- > Ken Irving, fn...@ua... > > ------------------------------------------------------------------------- > This SF.net email is sponsored by DB2 Express > Download DB2 Express C - the FREE version of DB2 express and take > control of your XML. No limits. Just data. Click to get it now. > http://sourceforge.net/powerbar/db2/ > _______________________________________________ > Expectperl-discuss mailing list > Exp...@li... > https://lists.sourceforge.net/lists/listinfo/expectperl-discuss > |
From: Ken I. <fn...@ua...> - 2007-07-06 14:51:34
|
On Thu, Jul 05, 2007 at 12:26:20AM -0700, markgo wrote: > > Hi, > > In some script I'm sending the command that runs some tool that could only > be stopped by pressing Ctrl-C. It does not wait for any input. Is there any > way to simulate this Ctrl-C (that is SIGINT) except closing the session? > > Currently it looks like that: > > $session = new Expect; > $session->spawn("su - $user_name") or die "..."; # Script runs as root > $session->expect(....); > ... > > $session->send("sudo $tool"); > > ... > > This is a tool I'd like to interrupt. > > $session->send("\cC") does not work, I suppose because the tool is not > waiting for input. > > Thank you, > Mark Why not just send the signal directly to the process: kill SIGINT $tool_pid; Ken -- Ken Irving, fn...@ua... |
From: Bryan B. <br...@bu...> - 2007-07-06 12:45:30
|
> Hi All, > > This is the string I am passing to the expect > "Do you want to uninstall depot \w+ from \w+ which is dependent" > > But, I am not getting why it is failling to match following line which > is printed on the terminal. > "Do you want to uninstall depot VRTSvxfs from slpam09 which is dependent" > > Basically, If I remove the regular expression strings from the inputed > string to expect ie. remove \w+ with the exact word, then it is working > fine. I am not getting what I have done wrong. > > Please help. > > <<<<<<<<<<<<<<<< PART OF THE CODE <<<<<<<<< > push (@match_patterns, "Do you want to uninstall depot \w+ from \w+ > which is dependent" ) ; > $functions[$#functions+1] = \&send_yes ; > Try single quotes. I think perl will enterpret "\w+" as "w+". Hope that helps. Bryan http://sourceforge.net/projects/rover/ |
From: Prasad J. <pra...@sy...> - 2007-07-06 11:15:51
|
Hi All, This is the string I am passing to the expect "Do you want to uninstall depot \w+ from \w+ which is dependent" But, I am not getting why it is failling to match following line which is printed on the terminal. "Do you want to uninstall depot VRTSvxfs from slpam09 which is dependent" Basically, If I remove the regular expression strings from the inputed string to expect ie. remove \w+ with the exact word, then it is working fine. I am not getting what I have done wrong. Please help. <<<<<<<<<<<<<<<< PART OF THE CODE <<<<<<<<< push (@match_patterns, "Do you want to uninstall depot \w+ from \w+ which is dependent" ) ; $functions[$#functions+1] = \&send_yes ; my $expect = $cluster->getExpect ($hosts[0]); ##### this returns an expect object $expect->expect($timeout, '-re', "MyPrompt>"); #### THIS IS A CALL TO EXPECT. my ( $matched_pattern_pos, $error, $matched_str, $before_match, $after_match) = $expect->expect( $timeout, '-re', @match_patterns ) ; <<<<<<<<<<<<<<<< I am not able to use regular expression in the expect string. Please help. Thanks and Regards, Prasad. |
From: markgo <gol...@gm...> - 2007-07-05 07:26:21
|
Hi, In some script I'm sending the command that runs some tool that could only be stopped by pressing Ctrl-C. It does not wait for any input. Is there any way to simulate this Ctrl-C (that is SIGINT) except closing the session? Currently it looks like that: $session = new Expect; $session->spawn("su - $user_name") or die "..."; # Script runs as root $session->expect(....); ... $session->send("sudo $tool"); ... This is a tool I'd like to interrupt. $session->send("\cC") does not work, I suppose because the tool is not waiting for input. Thank you, Mark -- View this message in context: http://www.nabble.com/Is-it-possible-to-interrupt-spawned-session-%28like-Ctrl-C%29-tf4028111.html#a11441982 Sent from the Perl - Expectperl-Discuss mailing list archive at Nabble.com. |
From: Matt Z. <mzagrabe@d.umn.edu> - 2007-06-25 14:15:34
|
> Why? I am not getting, Is there anything wrong that I have done. > Please help. you should increase logging verbosity. $object->log_stdout(1); $object->debug(3); --=20 Matt Zagrabelny - mzagrabe@d.umn.edu - (218) 726 8844 University of Minnesota Duluth Information Technology Systems & Services PGP key 1024D/84E22DA2 2005-11-07 Fingerprint: 78F9 18B3 EF58 56F5 FC85 C5CA 53E7 887F 84E2 2DA2 He is not a fool who gives up what he cannot keep to gain what he cannot lose. -Jim Elliot |
From: Prasad J. <pra...@sy...> - 2007-06-25 10:05:36
|
Hi All, This problem is being solved. But, there is one more problem that I am facing now. push (@match_patterns, 'Enter the system names separated by spaces on which to install \w+' ) ; this is matching the line ===> Enter the system names separated by spaces on which to install SFCFS But, push (@match_patterns, 'Enter a \w+ license key for \w+' ); Why this is not matching the line ==> Enter a SFCFS license key for swlx44: Why? I am not getting, Is there anything wrong that I have done. Please help. Thanks and Regards, Prasad. Prasad Joshi wrote: > Hi All, > > I am running in to a problem which is something I am not able to understand. > > Here, is the part of code. > > > my @match_patterns ; > > push (@match_patterns, 'Enter the system names separated by spaces > on which to install \w+' ) ; > push (@match_patterns, 'Enter a \w+ license key for \w+' ); > push (@match_patterns, "Do you want to enter another license key" ) ; > push (@match_patterns, "Select the rpms to be installed" ) ; > push (@match_patterns, "Press [Enter] to continue" ) ; > push (@match_patterns, "Are you ready to configure" ) ; > push (@match_patterns, "Will you be configuring I/O Fencing" ) ; > push (@match_patterns, "Enter the unique cluster name" ) ; > push (@match_patterns, "Enter the unique Cluster ID" ) ; > push (@match_patterns, "Enter the NIC for the first private > heartbeat link" ) ; > push (@match_patterns, 'Are you sure you want to use \w+ for the > first private heartbeat link' ) ; > push (@match_patterns, "Would you like to configure a second private > heartbeat link" ) ; > push (@match_patterns, "Enter the NIC for the low priority heartbeat > link" ) ; > push (@match_patterns, "Are you using the same NICs for private > heartbeat links on all systems" ) ; > push (@match_patterns, "Is this information correct" ) ; > push (@match_patterns, "Do you want to set up the enclosure-based > naming scheme" ) ; > push (@match_patterns, "Do you want to set up a default disk group > for each system" ) ; > push (@match_patterns, "Is the fully qualified hostname of system" ) ; > push (@match_patterns, "Enable Storage Foundation Management Server > Management" ) ; > > my $timeout = 1000 ; > my $expect = $cluster->getExpect ($hosts[0]); > $expect->expect($timeout, '-re', "MyPrompt>"); > $expect->send("ls -l\r"); > $expect->expect($timeout, '-re', "MyPrompt>"); > $expect->send ( "cd $buildarea\r" ) ; > $expect->expect($timeout, '-re', "MyPrompt>"); > $expect->send ( "./installsfcfs\r" ) ; > > > while (1) > { > my ( $matched_pattern_pos, $error, $matched_string, $before_match, > $after_match) = $expect->expect( $timeout, '-re', @match_patterns ) ; > $testEc->log ( "\n\nMatched String : $matched_string\n\n" ) ; > $testEc->log ( "\n\nMatched String : ", $matched_string, "\n\n" ) ; > } > <<<<<<<<<<<<<<<<<< > > The first line the "./installsfcfs" script prints is "Enter the > system names separated by spaces on which to install SFCFS:", now the > problem is > > $testEc->log ( "\n\nMatched String : $matched_string\n\n" ) ; ===> is > printing following message in the log files. > Matched String : Enter the system names separated by spaces on which to > install SFCFS > > and > > $testEc->log ( "\n\nMatched String : ", $matched_string, "\n\n" ) ; ==> > is printing > Matched String : > > This is something unexpected behavior, I am not getting why the > variable $matched_string is getting printed only if it is > included in the quotes. > > I think I am doing something wrong here, so Please help? > > Thanks and Regards, > Prasad. > > > |
From: Prasad J. <pra...@sy...> - 2007-06-25 09:50:40
|
Hi All, I am running in to a problem which is something I am not able to understand. Here, is the part of code. >>>>>>>>>>>>>>>>>>>>>>>>>>>>> my @match_patterns ; push (@match_patterns, 'Enter the system names separated by spaces on which to install \w+' ) ; push (@match_patterns, 'Enter a \w+ license key for \w+' ); push (@match_patterns, "Do you want to enter another license key" ) ; push (@match_patterns, "Select the rpms to be installed" ) ; push (@match_patterns, "Press [Enter] to continue" ) ; push (@match_patterns, "Are you ready to configure" ) ; push (@match_patterns, "Will you be configuring I/O Fencing" ) ; push (@match_patterns, "Enter the unique cluster name" ) ; push (@match_patterns, "Enter the unique Cluster ID" ) ; push (@match_patterns, "Enter the NIC for the first private heartbeat link" ) ; push (@match_patterns, 'Are you sure you want to use \w+ for the first private heartbeat link' ) ; push (@match_patterns, "Would you like to configure a second private heartbeat link" ) ; push (@match_patterns, "Enter the NIC for the low priority heartbeat link" ) ; push (@match_patterns, "Are you using the same NICs for private heartbeat links on all systems" ) ; push (@match_patterns, "Is this information correct" ) ; push (@match_patterns, "Do you want to set up the enclosure-based naming scheme" ) ; push (@match_patterns, "Do you want to set up a default disk group for each system" ) ; push (@match_patterns, "Is the fully qualified hostname of system" ) ; push (@match_patterns, "Enable Storage Foundation Management Server Management" ) ; my $timeout = 1000 ; my $expect = $cluster->getExpect ($hosts[0]); $expect->expect($timeout, '-re', "MyPrompt>"); $expect->send("ls -l\r"); $expect->expect($timeout, '-re', "MyPrompt>"); $expect->send ( "cd $buildarea\r" ) ; $expect->expect($timeout, '-re', "MyPrompt>"); $expect->send ( "./installsfcfs\r" ) ; while (1) { my ( $matched_pattern_pos, $error, $matched_string, $before_match, $after_match) = $expect->expect( $timeout, '-re', @match_patterns ) ; $testEc->log ( "\n\nMatched String : $matched_string\n\n" ) ; $testEc->log ( "\n\nMatched String : ", $matched_string, "\n\n" ) ; } <<<<<<<<<<<<<<<<<< The first line the "./installsfcfs" script prints is "Enter the system names separated by spaces on which to install SFCFS:", now the problem is $testEc->log ( "\n\nMatched String : $matched_string\n\n" ) ; ===> is printing following message in the log files. Matched String : Enter the system names separated by spaces on which to install SFCFS and $testEc->log ( "\n\nMatched String : ", $matched_string, "\n\n" ) ; ==> is printing Matched String : This is something unexpected behavior, I am not getting why the variable $matched_string is getting printed only if it is included in the quotes. I think I am doing something wrong here, so Please help? Thanks and Regards, Prasad. |
From: Juan P. F. G. <jfe...@gm...> - 2007-06-13 01:17:06
|
Hi all, just to share the solution to my problem... $rootexpect->exp_internal('2'); $rootexpect->expect($taim, "nnected"); $rootexpect->send("AT\015\012"); $rootexpect->expect($taim,"OK"); $rootexpect->send("ATDT 99999999\015\012"); my $x; $rootexpect->interact($x, 'XXX'); Now is dialing fine :) from: http://www.rocketaware.com/perl/perlfaq8/How_do_I_read_and_write_the_seri.htm end of line Some devices will be expecting a ``\r'' at the end of each line rather than a ``\n''. In some ports of perl, ``\r'' and ``\n'' are different from their usual (Unix) ASCII values of ``\012'' and ``\015''. You may have to give the numeric values you want directly, using octal (``\015''), hex (``0x0D''), or as a control-character specification (``\cM''). print DEV "atv1\012"; # wrong, for some devices print DEV "atv1\015"; # right, for some devices Even though with normal text files, a ``\n'' will do the trick, there is still no unified scheme for terminating a line that is portable between Unix, DOS/Win, and Macintosh, except to terminate ALL line ends with ``\015\012'', and strip what you don't need from the output. This applies especially to socket I/O and autoflushing, discussed next. |
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... |
From: Austin S. <te...@of...> - 2007-06-12 20:27:06
|
On Tue, Jun 12, 2007 at 12:41:25PM -0700, Juan Pablo Feria Gomez wrote: > Hello, I'm trying to expect an modem with cu session but i never got > answer from the modem . > > Here is my ugly code > > my $command = "cu -s 9600 -l ttyS0"; > if ($_[5] eq 'ROOT') { > print "Iniciando conexion telnet como ROOTEXPECT \n " > if ($debug eq "1"); > $rootexpect=Expect->spawn($command, @params) or die > "$command: $! FALLO\n"; > if ($_[9] eq "MODEM") { > my $timeout = "8"; > > $rootexpect->exp_internal('2'); > $rootexpect->expect($timeout, "nnected"); > $rootexpect->send("\n"); > $rootexpect->send("AT\n"); ^^ I suspect you need to send cu \r instead of \n. Austin |
From: Juan P. F. G. <jfe...@gm...> - 2007-06-12 19:41:28
|
Hello, I'm trying to expect an modem with cu session but i never got answer from the modem . Here is my ugly code my $command = "cu -s 9600 -l ttyS0"; if ($_[5] eq 'ROOT') { print "Iniciando conexion telnet como ROOTEXPECT \n " if ($debug eq "1"); $rootexpect=Expect->spawn($command, @params) or die "$command: $! FALLO\n"; if ($_[9] eq "MODEM") { my $timeout = "8"; $rootexpect->exp_internal('2'); $rootexpect->expect($timeout, "nnected"); $rootexpect->send("\n"); $rootexpect->send("AT\n"); $rootexpect->expect($timeout,"OK"); my $x; $rootexpect->interact($x, 'XXX'); } } Here is the debug output (Looks like modem is not acepting the \n after AT) spawn id(4): Does `\007Connected.\r\n' match: pattern #1: -ex `nnected'? YES!! Before match string: `\007Co' Match string: `nnected' After match string: `.\r\n' Matchlist: () 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\nAT\n' match: pattern #1: -ex `OK'? No. With the script @ interact mode AT responds fine at OK at OK at OK I connected a cisco router console port instead the modem, and changed the expect commands: $rootexpect->exp_internal('2'); $rootexpect->expect($timeout, "nnected"); $rootexpect->send("\n"); $rootexpect->expect($tiemout, "outer"); $rootexpect->send("ter le 0\n"); $rootexpect->send("sh ver\n"); $rootexpect->expect($timeout,"isco"); my $x; $rootexpect->interact($x, 'XXX'); And the router successfully returns the output of the command 'sh ver'... Any Ideas? Are there better terminals than cu, which can be used to interact with expect-perl? Thanks in advance |
From: Bruno N. <bn...@gm...> - 2007-06-12 04:52:57
|
Hello Roland and guys on the list, Thank you for maintaining the Expect module. I'd like to inform you of a very annoying bug in ssh.pl script that almost ruined me when i was trying to learn expect. The bug consist of mistakenly assingning two different instances of Expect class to the $spaw variable. The two assignments are marked with '<<<<<<<' : -------------ssh.pl snippet--------------------------------- my $spawn = new Expect; <<<<<<<<<<<< instance one $spawn->raw_pty(1); # This gets the size of your terminal window $spawn->slave->clone_winsize_from(\*STDIN); my $PROMPT; # This function traps WINCH signals and passes them on sub winch { my $signame = shift; my $pid = $spawn->pid; $shucks++; print "count $shucks,pid $pid, SIG$signame\n"; $spawn->slave->clone_winsize_from(\*STDIN); kill WINCH => $spawn->pid if $spawn->pid; } $SIG{WINCH} = \&winch; # best strategy $spawn=Expect->spawn("ssh $username\@$host"); <<<<<<<<<<< Instance two!!!!! # log everything if you want # $spawn->log_file("/tmp/autossh.log.$$"); -----------------end ssh.pl snippet--------------------------- After the second assignment all the configuration done previously is lost, remarkably the setting '$spawn->raw_pty(1)' that dramatically changes the behaviour of CRLF convertions. By reading your ssh.pl i thought that using raw_pty(1) was necessary for my own application - but it wasn't!! It took me 10 hours to discover this!!! >:-( I don't understand much about terminals and character convertions so this bug was incredibly difficult to understand in my tests. When you'll fix ssh.pl, all the setting done before the second assignment is not needed. the script works perfectly only with the second assingment on. Hope this helps, bruno |
From: Ken I. <fn...@ua...> - 2007-06-09 03:12:21
|
On Fri, Jun 08, 2007 at 10:41:33AM +0200, Roland Giersig wrote: > Well, not out of the box and I'm not sure if it works correctly, that > part (interact()) never was used in production and thus isn't really > tested. I cannot remember to have received feedback from somebody who > actually is using interact(). I'm using interact, but have it looking for a string, not a regex as I think the OP was looking for: $exp->interact(\*STDIN, 'BAIL!'); Ken > It should be possible by using interconnect(). You have to set up the > objects to interconnect on your own, using set_group() and set_seq() > and then calling interconnect(). Try using the source code for > interact() as an example and work from there... > > > Servus aus Wien! > > Roland > > On 6/6/07, Albrecht Bischoff <al...@nm...> wrote: > > Hello, > > > > is there a similar mechnism in expectperl for using the following expect > > code: > > > > --- expect code snippet --- > > interact { > > -o > > -re "..." { send "..."} > > } > > ---- > > > > The Expect.pm-documentation for $object->interact( "\*FILEHANDLE, > > $escape_sequence") states "Interaction ceases when $escape_sequence is > > read from FILEHANDLE, not $object. $object's listen group will consist > > solely of \*FILEHANDLE for the duration of the interaction." > > > > So, my question in other words: is there any possibility to cease > > interaction based on a (regex) pattern, read from $object? Any > > workaround, if not possible using interact()? > > > > Thanks in advance, > > Albrecht > > > > ------------------------------------------------------------------------- > > This SF.net email is sponsored by DB2 Express > > Download DB2 Express C - the FREE version of DB2 express and take > > control of your XML. No limits. Just data. Click to get it now. > > http://sourceforge.net/powerbar/db2/ > > _______________________________________________ > > Expectperl-discuss mailing list > > Exp...@li... > > https://lists.sourceforge.net/lists/listinfo/expectperl-discuss > > > > ------------------------------------------------------------------------- > This SF.net email is sponsored by DB2 Express > Download DB2 Express C - the FREE version of DB2 express and take > control of your XML. No limits. Just data. Click to get it now. > http://sourceforge.net/powerbar/db2/ > _______________________________________________ > Expectperl-discuss mailing list > Exp...@li... > https://lists.sourceforge.net/lists/listinfo/expectperl-discuss -- Ken Irving, fn...@ua..., 907-474-6152 Water and Environmental Research Center Institute of Northern Engineering University of Alaska, Fairbanks |