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: Syamala T. <sya...@or...> - 2002-05-17 20:38:37
|
I have made significant improvement from 24hrs to 4.5hrs. by clearing accumulator after every time out of 15sec. It could make more saving if I set the time out to say 3 seconds or so. Now then, I have still the CPU monopolization occurring of course. As suggested, I am going to try set the Exp_Max_Accum to 8096. I can reports my findings once I see them. I have the following questions. 1. Why can't I have a method in Expect which can allow me to truncate the accumulator to the point of pattern matching. If present, I could simply call the method once I find a match. This could prevent the buffer/accumulator from choking. 2. Expect can trim the accumulator at each each match to a configurable size, say a default of 4k. This should be done evenly at time out points also. This could as well prevent accumulator/buffer from choking. By the way, I found another machine, which is NOT Linux also hit by the same issue. So, it is not Linux specific problem. -Syamal. --------- Austin Schutz wrote: > On Tue, May 14, 2002 at 06:04:28PM -0700, Syamala Tadigadapa wrote: > > I have an in house perl application that uses Expect to tail to a legacy > > program. > > I have it run satisfactorily on multiple platforms. > > > > On linux platforms, I have sean a strange problem. The perl executable > > monopolizing > > a cpu after a while of execution time. The legacy program is too > > loquacious and writes > > a lot of stuff on the STDOUT. Perhaps thousands of lines are being > > shown on STDOUT. > > > > The program is running correctly, but unbearably slow! Slow over 10 > > times or worse. > > > > Expect by default will match the entire output for a match everytime > more output is created by the spawned program. If you have a verbose program > that doesn't match it becomes difficult for perl to keep up. Typically the > answer is to set max_accum() to some sane value, perhaps 10000. What can go > wrong is if you set the max value to less than what is read you may lose > matching data. > Currently expect will read up to 8096 bytes at a time from a > stream. Hmm, maybe it would make sense to make this some fraction of > exp_Max_Accum. Alternately maybe it would make sense to trim exp_Accum _after_ > the pattern matches rather than before. > > Austin |
From: SYAMALA.TADIGADAPA <SYA...@or...> - 2002-05-15 20:57:08
|
Is this verbose output from the legacy program specific to the Linux environment? Not. What is being done with the output on a match, is it maintained or discarded? Discard. [ Do I need to any special action to clear the accumulating output from the program spawned by Expect? After a match I usually take some action like saving matched pattern in an array, responding toprogram with some string etc. ] What is the memory utilization compared to the other platforms? I have notmade any measurements and/or comparisons against any other platform. Everywhere elese, the application is behaving normally. The only platform specific problems we've had with Expect.pm under Linux was a process count utilization. Can it cause the perl executable to monopolize one of the CPUs? Can you please educate me on this process count utilization. : From: Syamala Tadigadapa [mailto:sya...@or...] : : On linux platforms, I have sean a strange problem. The perl executable : monopolizing : a cpu after a while of execution time. The legacy program is too : loquacious and writes : a lot of stuff on the STDOUT. Perhaps thousands of lines are being : shown on STDOUT. Is this verbose output from the legacy program specific to the Linux environment? What is being done with the output on a match, is it maintained or discarded? What is the memory utilization compared to the other platforms? The only platform specific problems we've had with Expect.pm under Linux was a process count utilization. Mark -- [] Mark Rogaski "Computers save time like [] AT&T Frame Relay Service kudzu prevents soil erosion" [] email: ro...@at... -- Al Castanoli [] voice: 732-885-7534 fax: 732-885-7699 [] pager: 888-858-7243 pin 200853 or 20...@pa... |
From: Austin S. <te...@of...> - 2002-05-15 02:22:08
|
On Tue, May 14, 2002 at 06:04:28PM -0700, Syamala Tadigadapa wrote: > I have an in house perl application that uses Expect to tail to a legacy > program. > I have it run satisfactorily on multiple platforms. > > On linux platforms, I have sean a strange problem. The perl executable > monopolizing > a cpu after a while of execution time. The legacy program is too > loquacious and writes > a lot of stuff on the STDOUT. Perhaps thousands of lines are being > shown on STDOUT. > > The program is running correctly, but unbearably slow! Slow over 10 > times or worse. > Expect by default will match the entire output for a match everytime more output is created by the spawned program. If you have a verbose program that doesn't match it becomes difficult for perl to keep up. Typically the answer is to set max_accum() to some sane value, perhaps 10000. What can go wrong is if you set the max value to less than what is read you may lose matching data. Currently expect will read up to 8096 bytes at a time from a stream. Hmm, maybe it would make sense to make this some fraction of exp_Max_Accum. Alternately maybe it would make sense to trim exp_Accum _after_ the pattern matches rather than before. Austin |
From: Rogaski, M. A. <ro...@at...> - 2002-05-15 01:51:50
|
Make that: a process count limitation. Mark -- [] Mark Rogaski "Computers save time like=20 [] AT&T Frame Relay Service kudzu prevents soil erosion" [] email: ro...@at... -- Al Castanoli [] voice: 732-885-7534 fax: 732-885-7699 [] pager: 888-858-7243 pin 200853 or 20...@pa...=20 : -----Original Message----- : From: Rogaski, Mark, ALCNS=20 : Sent: Tuesday, May 14, 2002 9:34 PM : To: Syamala Tadigadapa; exp...@li... : Subject: RE: [Expectperl-discuss] Expect on linux monopolizes cpu! :=20 :=20 : : From: Syamala Tadigadapa [mailto:sya...@or...] : :=20 : : On linux platforms, I have sean a strange problem. The perl=20 : executable : : monopolizing : : a cpu after a while of execution time. The legacy program is too : : loquacious and writes : : a lot of stuff on the STDOUT. Perhaps thousands of lines are being : : shown on STDOUT. :=20 : Is this verbose output from the legacy program specific to=20 : the Linux environment? What is being done with the output on=20 : a match, is it maintained or discarded? What is the memory=20 : utilization compared to the other platforms? The only=20 : platform specific problems we've had with Expect.pm under=20 : Linux was a process count utilization. :=20 : Mark :=20 : -- : [] Mark Rogaski "Computers save time like=20 : [] AT&T Frame Relay Service kudzu prevents soil erosion" : [] email: ro...@at... -- Al Castanoli : [] voice: 732-885-7534 fax: 732-885-7699 : [] pager: 888-858-7243 pin 200853 or 20...@pa...=20 :=20 :=20 : _______________________________________________________________ :=20 : Have big pipes? SourceForge.net is looking for download=20 : mirrors. We supply : the hardware. You get the recognition. Email Us:=20 : ban...@so... : _______________________________________________ : Expectperl-discuss mailing list : Exp...@li... : https://lists.sourceforge.net/lists/listinfo/expectperl-discuss :=20 |
From: Rogaski, M. A. <ro...@at...> - 2002-05-15 01:33:56
|
: From: Syamala Tadigadapa [mailto:sya...@or...] :=20 : On linux platforms, I have sean a strange problem. The perl executable : monopolizing : a cpu after a while of execution time. The legacy program is too : loquacious and writes : a lot of stuff on the STDOUT. Perhaps thousands of lines are being : shown on STDOUT. Is this verbose output from the legacy program specific to the Linux = environment? What is being done with the output on a match, is it = maintained or discarded? What is the memory utilization compared to the = other platforms? The only platform specific problems we've had with = Expect.pm under Linux was a process count utilization. Mark -- [] Mark Rogaski "Computers save time like=20 [] AT&T Frame Relay Service kudzu prevents soil erosion" [] email: ro...@at... -- Al Castanoli [] voice: 732-885-7534 fax: 732-885-7699 [] pager: 888-858-7243 pin 200853 or 20...@pa...=20 |
From: Syamala T. <sya...@or...> - 2002-05-15 01:05:44
|
I have an in house perl application that uses Expect to tail to a legacy program. I have it run satisfactorily on multiple platforms. On linux platforms, I have sean a strange problem. The perl executable monopolizing a cpu after a while of execution time. The legacy program is too loquacious and writes a lot of stuff on the STDOUT. Perhaps thousands of lines are being shown on STDOUT. The program is running correctly, but unbearably slow! Slow over 10 times or worse. The Expect module was Expect 1.12, when problem was discovered. I have switched from Expect 1.12 to the latest Expect 1.15. Problem persists. [ Basically the perl application uses expect to match from a hoard of patterns (about 60) in a loop. ] Does some body has a clue as to what is going on? -Syamal. ----------- |
From: <RGi...@a1...> - 2002-05-06 12:27:24
|
> I am using Expect 1.15 on the Perl for Cygwin release 5.6.1-2. I > want to use Expect with SSH2 to automate some commands that I have to do > regularly on remote servers. First of all, please note the following FAQs from Expect: I want to automate password entry for su/ssh/scp/rsh/... You shouldn't use Expect for this. Putting passwords, especially root passwords, into scripts in clear text can mean severe security problems. I strongly recommend using other means. For 'su', consider switching to 'sudo', which gives you root access on a per-command and per-user basis without the need to enter passwords. 'ssh'/'scp' can be set up with RSA authentication without passwords. 'rsh' can use the .rhost mechanism, but I'd strongly suggest to switch to 'ssh'; to mention 'rsh' and 'security' in the same sentence makes an oxymoron. It will work for 'telnet', though, and there are valid uses for it, but you still might want to consider using 'ssh', as keeping cleartext passwords around is very insecure. I want to use Expect to automate [anything with a buzzword]... Are you sure there is no other, easier way? As a rule of thumb, Expect is useful for automating things that expect to talk to a human, where no formal standard applies. For other tasks that do follow a well-defined protocol, there are often better-suited modules that already can handle those protocols. Don't try to do HTTP requests by spawning telnet to port 80, use LWP instead. To automate FTP, take a look at the Net::FTP manpage or "ncftp" (http://www.ncftp.org). You don't use a screwdriver to hammer in your nails either, or do you? > But so far I have not been able to do this properly. I am using F- > Secure SSH for Windows, maybe this causes some trouble? Definitely, you shouldn't mix native Windows applications with Cygwin. Use the 'ssh' from Cygwin instead. > With F-Secure SSH2, I am not > able to give any parameter to the process, and with a sftp2 from > SSH, the password is entered succesfully by the script after catching the > password prompt, but then I can't do anything else, as Expect doesn't seem > to catch the prompt given by sftp2. > > Some other tests seem to show that I have the same problem when > using ftp. Again, always use Cygwin applications. Expect cannot deal with native Windows applications, the underlying model is too different. That's why there is not native Windows version of IO-Tty, which Expect builds upon. I'd recommend you look into RSA authentication without passphrase to automate your remote commands without the need to enter a password. Then you probably don't need Expect, a simple $output = qx(ssh $remote_host $command); or similar system() call should suffice. Expect is very useful if you have to emulate a human at the keyboard, for other tasks it's just overkill. Hope this helps, Roland -- RGi...@cp... |
From: Mathias D. <mde...@ho...> - 2002-05-06 12:07:11
|
Hello, I am using Expect 1.15 on the Perl for Cygwin release 5.6.1-2. I want to use Expect with SSH2 to automate some commands that I have to do regularly on remote servers. But so far I have not been able to do this properly. I am using F-Secure SSH for Windows, maybe this causes some trouble? With F-Secure SSH2, I am not able to give any parameter to the process, and with a sftp2 from SSH, the password is entered succesfully by the script after catching the password prompt, but then I can't do anything else, as Expect doesn't seem to catch the prompt given by sftp2. Some other tests seem to show that I have the same problem when using ftp. The prompt is shown on the screen, but Expect won't catch it. Is this a known issue?? I'm getting quite desperate. Here is my very simple sample script: ---------------------------------------------------------- #! /usr/bin/perl -w use Expect $Expect::Log_Stdout=1; $Expect::Exp_Internal=1; my $cmd="/path/sftp2 -P port user\@IP.IP.IP.IP"; my $process = new Expect; $process->raw_pty(1); $process->spawn($cmd); $process->expect(10, "word: "); $process->send("mypassword\n"); $process->expect(10, "sftp>"); # here, sftp> appears on the screen, but isn't read by Expect $process->send("ls\n"); # consequently, ls\n is written after the timeout occurs, but there is no reaction from sftp. Moreover, if I type the ls command by hand on the keyboard, it'll work $process->expect("sftp>"); _________________________________________________________________ Chat with friends online, try MSN Messenger: http://messenger.msn.com |
From: Warren P. <wpo...@ve...> - 2002-05-01 15:29:01
|
Hello, I'm using cpan to "install Bundle::Expect" and get the following error - a complaint about the version of IO::Pty. I'm expecting an install error because I don't have permission to write to the /usr/local/lib directories on this box - I was going to "make install" after edit'ing the Makefile so that it would install in my directory. Can I fix this? Thanks, Warren -------------[ partial output of "install Bundle::Expect" ]------------ CPAN.pm: Going to build R/RG/RGIERSIG/Expect-1.15.tar.gz mkdir blib mkdir blib/lib mkdir blib/arch mkdir blib/arch/auto mkdir blib/arch/auto/Expect mkdir blib/lib/auto mkdir blib/lib/auto/Expect cp Expect.pod blib/lib/Expect.pod cp Expect.pm blib/lib/Expect.pm /sbin/make -- OK Running make test PERL_DL_NONLAZY=1 /usr/sbin/perl -Iblib/arch -Iblib/lib -I/usr/local/lib/perl56/5.6.0/irix-n32 -mips3 -I/usr/local/lib/perl56/5.6.0 test.pl 1..36 IO::Pty version 0.97 required--this is only version 0.01 at blib/lib/Expect.pm line 22. BEGIN failed--compilation aborted at blib/lib/Expect.pm line 22. Compilation failed in require at test.pl line 27. BEGIN failed--compilation aborted at test.pl line 27. *** Error code 255 (bu21) /sbin/make test -- NOT OK |
From: <RGi...@a1...> - 2002-04-29 12:14:26
|
> I was looking for an archive for the expect perl mailing lists. Are > they posted anywhere on the web? I couldn't find any. Yes, they are archived at GeoCrawler (http://www.geocrawler.com), just follow the mailinglists link from http://sourceforge.net/projects/expectperl/ Hope this helps, Roland -- RGi...@cp... |
From: <RGi...@a1...> - 2002-04-19 10:14:50
|
> Something I don't quite understand about this is that RSA > authentication only seems to check to see if you have a matching > key and password. That is to say, it doesn't seem to check to > make sure the host you are coming from is the one that matches > your key. If you set up RSA w/ no password, then all someone > would need to do is copy your key to their machine to gain > access. This doesn't seem especially secure to me vs. any > other method, especially .shosts. Yes, and that is why the ssh docs disapprove keys without passwords and recommend using ssh-agent. Unfortunately automating things means you have to compromize. > Maybe this is just local > configuration, but it seems to be the default. Is there some > way to turn on host checking that I missed? Yes, you can specify 'from=<hostnamepatterns>' in authorized_keys to limit accessibility to the account. This isn't entirely secure either, but to circumvent it, the attacker must also compromize DNS and/or IP routing. Note that even a client host key check doesn't mean improved security if the client system is compromized. > The one thing about keeping cleartext passwords around that's good > is that the security implications are obvious. Unfortunately not to everyone... :-( I concurr that there is no principal difference in security between a file with cleartext passwords and a key file with non-password- protected keys from a security point of view. But using the second one is much simpler, you may even not need Expect for it, normal ssh calls are often enough! And reduced complexity benefits everyone. Roland -- RGi...@cp... |
From: Austin S. <te...@of...> - 2002-04-18 17:03:45
|
On Thu, Apr 18, 2002 at 11:56:57AM +0200, RGi...@a1... wrote: > You shouldn't use Expect for this. Putting passwords, especially > root passwords, into scripts in clear text can mean severe security > problems. I strongly recommend using other means. For 'su', consider > switching to 'sudo', which gives you root access on a per-command and > per-user basis without the need to enter passwords. 'ssh'/'scp' can be > set up with RSA authentication without passwords. 'rsh' can use > the .rhost mechanism, but I'd strongly suggest to switch to 'ssh'; to > mention 'rsh' and 'security' in the same sentence makes an oxymoron. > Something I don't quite understand about this is that RSA authentication only seems to check to see if you have a matching key and password. That is to say, it doesn't seem to check to make sure the host you are coming from is the one that matches your key. If you set up RSA w/ no password, then all someone would need to do is copy your key to their machine to gain access. This doesn't seem especially secure to me vs. any other method, especially .shosts. Maybe this is just local configuration, but it seems to be the default. Is there some way to turn on host checking that I missed? The one thing about keeping cleartext passwords around that's good is that the security implications are obvious. If you keep them in a file accessible only by yourself then someone would have to be either you or root to gain access. If you combine that with tcp wrappers at the remote end I'd say it's reasonably secure - though again probably not as good as .shosts, which _does_ seem to check vs. ssh's known_hosts file to make sure you're coming from the correct host. Austin |
From: Olivier A. <Oli...@if...> - 2002-04-18 13:09:24
|
RGi...@a1... wrote: >>I'm trying to exit perl whith an exit code after doing some expect >>stuff, but the exit code is always set to 1. What I'm doing wrong ? >>here is my test code: >>#!/usr/bin/perl -w >>use strict; >>use Expect; >> >>my $exp=Expect->spawn("csh") or die "error: $!"; >>print $exp "exit 3"; >>exit 3; >> >> >>%./test.pl >>%echo ?$ >> > ^^ I hope this is only a typo.... > yes it was >>1 >>% >> > >Try "perl -e 'exit 3'; echo $?", which should print "3". '$?' is only >valid within the same shell command, so it's no wonder you don't see >it... > >If you want to capture the exit status of a spawned process, try > > my $exp = Expect->spawn("csh"); > $exp->send("exit 3\n"); > $exp->expect(5); > print "exitstatus: ".$exp->exitstatus."\n"; > >which prints "exitstatus: 768" on my system. > $exp->expect(5); $exp->exitstatus; that's definitivly help me. Many thanks! > > >Hope this helps, > >Roland >-- >RGi...@cp... > -- Olivier |
From: <RGi...@a1...> - 2002-04-18 10:14:19
|
> I'm trying to exit perl whith an exit code after doing some expect > stuff, but the exit code is always set to 1. What I'm doing wrong ? > here is my test code: > #!/usr/bin/perl -w > use strict; > use Expect; > > my $exp=Expect->spawn("csh") or die "error: $!"; > print $exp "exit 3"; > exit 3; > > > %./test.pl > %echo ?$ ^^ I hope this is only a typo.... > 1 > % > Try "perl -e 'exit 3'; echo $?", which should print "3". '$?' is only valid within the same shell command, so it's no wonder you don't see it... If you want to capture the exit status of a spawned process, try my $exp = Expect->spawn("csh"); $exp->send("exit 3\n"); $exp->expect(5); print "exitstatus: ".$exp->exitstatus."\n"; which prints "exitstatus: 768" on my system. Hope this helps, Roland -- RGi...@cp... |
From: <RGi...@a1...> - 2002-04-18 09:57:09
|
> I have a stupid question: > > I want to do the following but in perl using the expect perl > module. > ----------- Start expect code > spawn ssh -l $user $argv > expect "${user}@${argv}'s password:" > send "$password\r" From the Expect manpage: "I want to automate password entry for su/ssh/scp/rsh/... You shouldn't use Expect for this. Putting passwords, especially root passwords, into scripts in clear text can mean severe security problems. I strongly recommend using other means. For 'su', consider switching to 'sudo', which gives you root access on a per-command and per-user basis without the need to enter passwords. 'ssh'/'scp' can be set up with RSA authentication without passwords. 'rsh' can use the .rhost mechanism, but I'd strongly suggest to switch to 'ssh'; to mention 'rsh' and 'security' in the same sentence makes an oxymoron. It will work for 'telnet', though, and there are valid uses for it, but you still might want to consider using 'ssh', as keeping cleartext passwords around is very insecure. Source Examples How to automate login my $exp = Expect->spawn("telnet localhost") or die "Cannot spawn telnet: $!\n";; my $spawn_ok; $exp->expect($timeout, [ qr'login: $', sub { $spawn_ok = 1; my $fh = shift; $fh->send("$username\n"); exp_continue; } ], [ 'Password: $', sub { my $fh = shift; print $fh "$password\n"; exp_continue; } ], [ eof => sub { if ($spawn_ok) { die "ERROR: premature EOF in login.\n"; } else { die "ERROR: could not spawn telnet.\n"; } } ], [ timeout => sub { die "No login.\n"; } ], '-re', qr'[#>:] $', #' wait for shell prompt, then exit ); Hope this helps, Roland -- RGi...@cp... |
From: Ed R. <er...@pa...> - 2002-04-17 21:31:01
|
Tin...@Te... writes: > Thanks for your help. I am actually interacting with a Riverstone router. > > A similar command on Riverstone is cli set terminal rows 0, but I am still > seeing some control characters. Oops, I should have looked just a little closer at your email - that's not quite Cisco syntax, is it? Anyway, going back to your original query, when your Expect code was matching against the router prompt, since the Riverstone was re-echoing the entire line, including the prompt, you were matching too early. Suggest you get C-Kermit or another decent terminal emulator and use it in debug mode to see exactly what the Riverstone is sending you during a session - then you can program for it as needed. You might have success using a pattern that ends with "\Z" (end of buffer), since the example you sent us earlier didn't show any junk at the end of the buffer. Also, look further in your Riverstone docs, maybe you can find some way to turn off the formatting. |
From: Blackstone, J. D. <jda...@ci...> - 2002-04-17 20:34:40
|
-----Original Message----- From: Tin...@Te... [mailto:Tin...@Te...] Sent: Wednesday, April 17, 2002 3:24 PM To: er...@pa... Cc: exp...@li... Subject: RE: [Expectperl-discuss] unexpected \r and other chars. Oops, I think it makes to me now. The ^ in the bracket means negate right? OK, thanks. Ting Ting, May I suggest you look into getting copies of _Programming Perl_ (the "Camel" book) and _Learning Perl_ (the "Llama" book) from O'Reilly, if you don't already have them? Learning Expect.pm is pretty difficult, and it's a good idea to be know as much as possible about Perl in general and regular expressions before you get in too deep. Some people may recommend another O'Reilly book specifically about regular expressions, but it's really highly advanced so I would consult the other two first. (I never found the regex book to be needed, but the others are indispensable.) Happy coding! jdb |
From: <Tin...@Te...> - 2002-04-17 20:26:16
|
Oops, I think it makes to me now. The ^ in the bracket means negate right? OK, thanks. Ting > -----Original Message----- > From: Ting Cai > Sent: Wednesday, April 17, 2002 1:20 PM > To: 'Ed Ravin' > Cc: exp...@li... > Subject: RE: [Expectperl-discuss] unexpected \r and other chars. > > Hi, Ed, > > Thanks for your help. I am actually interacting with a Riverstone router. > > A similar command on Riverstone is cli set terminal rows 0, but I am still > seeing some control characters. > > Can you explain a little about "# ", try "^[^#]+# "? > > ^ means the beginning of the line, + means one or more of the previous > character, [] means any one of the characters in the [], right? > > I don't see how it can used to match new prompt? > > Thanks again. > > Ting > > > > > > > -----Original Message----- > > From: Ed Ravin [mailto:er...@pa...] > > Sent: Wednesday, April 17, 2002 9:22 AM > > To: Ting Cai > > Cc: exp...@li... > > Subject: Re: [Expectperl-discuss] unexpected \r and other chars. > > > > Tin...@Te... writes: > > > I am seeing a bunch of extra characters inserted between the command I > > sent. > > > I sent 'copy startup to bootflash:lab-baseline.conf\n', but the string > > used > > > in matching is: > > > > > > ---- > > > Does `copy \033[?25l\rlab1nnisaa02.lab# copy > > > > > > \015\033[C\033[C\033[C\033[C\033[C\033[C\033[C\033[C\033[C\033[C\033[C\033 > > [C > > > \033[C' > > > > Looks like you're talking to a Cisco router, and the router is sending > > terminal escape codes as part of its echoback. I see "<esc> [ ? 25 l" > > (some kind of reset mode command) and lots of "<esc> [ C" (cursor > right). > > The Cisco is probably trying to do command line editing or otherwise > > reformatting the echo of your input to make things look nice. > > > > You need to send "terminal width 0" and "terminal length 0" to the > router > > before starting to interact with it. That will keep the Cisco from > > sending > > screen formatting codes to the terminal, or from pausing during the > > output of multi-line commands. > > > > Feel free to steal code from aclmaker, a tool I wrote that interacts > > with Cisco routers to manage access control lists - it's over at: > > > > http://prdownloads.sourceforge.net/cosi-nms/aclmaker-perl-1.02.txt > > > > See the subroutines "open_router" and "get_prompt" in that program for > > how I dealt with some of these issues. > > > > You probably also want to make your match strings more precise - > > instead of "# ", try "^[^#]+# " to match a new router prompt, > > and " \[no\]" to match the confirmation question. Or you can steal > > aclmaker's logic, which discovers the router's prompt dynamically > > and tries to match that during subsequent commands. > > > > -- Ed |
From: <Tin...@Te...> - 2002-04-17 20:21:56
|
Hi, Ed, Thanks for your help. I am actually interacting with a Riverstone router. A similar command on Riverstone is cli set terminal rows 0, but I am still seeing some control characters. Can you explain a little about "# ", try "^[^#]+# "? ^ means the beginning of the line, + means one or more of the previous character, [] means any one of the characters in the [], right? I don't see how it can used to match new prompt? Thanks again. Ting > -----Original Message----- > From: Ed Ravin [mailto:er...@pa...] > Sent: Wednesday, April 17, 2002 9:22 AM > To: Ting Cai > Cc: exp...@li... > Subject: Re: [Expectperl-discuss] unexpected \r and other chars. > > Tin...@Te... writes: > > I am seeing a bunch of extra characters inserted between the command I > sent. > > I sent 'copy startup to bootflash:lab-baseline.conf\n', but the string > used > > in matching is: > > > > ---- > > Does `copy \033[?25l\rlab1nnisaa02.lab# copy > > > \015\033[C\033[C\033[C\033[C\033[C\033[C\033[C\033[C\033[C\033[C\033[C\033 > [C > > \033[C' > > Looks like you're talking to a Cisco router, and the router is sending > terminal escape codes as part of its echoback. I see "<esc> [ ? 25 l" > (some kind of reset mode command) and lots of "<esc> [ C" (cursor right). > The Cisco is probably trying to do command line editing or otherwise > reformatting the echo of your input to make things look nice. > > You need to send "terminal width 0" and "terminal length 0" to the router > before starting to interact with it. That will keep the Cisco from > sending > screen formatting codes to the terminal, or from pausing during the > output of multi-line commands. > > Feel free to steal code from aclmaker, a tool I wrote that interacts > with Cisco routers to manage access control lists - it's over at: > > http://prdownloads.sourceforge.net/cosi-nms/aclmaker-perl-1.02.txt > > See the subroutines "open_router" and "get_prompt" in that program for > how I dealt with some of these issues. > > You probably also want to make your match strings more precise - > instead of "# ", try "^[^#]+# " to match a new router prompt, > and " \[no\]" to match the confirmation question. Or you can steal > aclmaker's logic, which discovers the router's prompt dynamically > and tries to match that during subsequent commands. > > -- Ed |
From: Blackstone, J. D. <jda...@ci...> - 2002-04-17 19:56:49
|
> The following code is close but how do I continue after > logging in with username/password and execute a > series of command? > > If I put qr/$prompt/ > > $exp->expect($timeout,, sub... > commands > > It goes into an endless loop. Don't use exp_continue. Use a separate $exp->expect for each step. > > ----------- Start perl code > [ qr/username: /i, sub { my $self = shift; > $self->send("$username\n"); > exp_continue; }], > [ qr/password: /i, sub { my $self = shift; > $self->send("$password\n"); > exp_continue; }], > $shell_prompt); > ----------- Start perl code $exp->expect(qr/username: /i); $exp->send("$username\r"); $exp->expect(qr/password: /i); $exp->send("$password\r"); $exp->expect("$shell_prompt"); ... This should work, unless there's a particular reason you wanted to use one expect statement for them all (perhaps the username and/or password prompts are optional?). jdb |
From: Ed R. <er...@pa...> - 2002-04-17 16:21:44
|
Tin...@Te... writes: > I am seeing a bunch of extra characters inserted between the command I sent. > I sent 'copy startup to bootflash:lab-baseline.conf\n', but the string used > in matching is: > > ---- > Does `copy \033[?25l\rlab1nnisaa02.lab# copy > \015\033[C\033[C\033[C\033[C\033[C\033[C\033[C\033[C\033[C\033[C\033[C\033[C > \033[C' Looks like you're talking to a Cisco router, and the router is sending terminal escape codes as part of its echoback. I see "<esc> [ ? 25 l" (some kind of reset mode command) and lots of "<esc> [ C" (cursor right). The Cisco is probably trying to do command line editing or otherwise reformatting the echo of your input to make things look nice. You need to send "terminal width 0" and "terminal length 0" to the router before starting to interact with it. That will keep the Cisco from sending screen formatting codes to the terminal, or from pausing during the output of multi-line commands. Feel free to steal code from aclmaker, a tool I wrote that interacts with Cisco routers to manage access control lists - it's over at: http://prdownloads.sourceforge.net/cosi-nms/aclmaker-perl-1.02.txt See the subroutines "open_router" and "get_prompt" in that program for how I dealt with some of these issues. You probably also want to make your match strings more precise - instead of "# ", try "^[^#]+# " to match a new router prompt, and " \[no\]" to match the confirmation question. Or you can steal aclmaker's logic, which discovers the router's prompt dynamically and tries to match that during subsequent commands. -- Ed |
From: <ngi...@ne...> - 2002-04-17 09:49:28
|
I have a stupid question: I want to do the following but in perl using the expect perl module. ----------- Start expect code spawn ssh -l $user $argv expect "${user}@${argv}'s password:" send "$password\r" interact -o -nobuffer -re $prompt return send "command1\r" interact -o -nobuffer -re $prompt return send "command2\r" interact -o -nobuffer -re $prompt return send "command3\r" interact -o -nobuffer -re $prompt return ----------- End expect code The following code is close but how do I continue after logging in with username/password and execute a series of command? If I put qr/$prompt/ $exp->expect($timeout,, sub... commands It goes into an endless loop. ----------- Start perl code [ qr/username: /i, sub { my $self = shift; $self->send("$username\n"); exp_continue; }], [ qr/password: /i, sub { my $self = shift; $self->send("$password\n"); exp_continue; }], $shell_prompt); ----------- Start perl code Thanks! __________________________________________________________________ Your favorite stores, helpful shopping tools and great gift ideas. Experience the convenience of buying online with Shop@Netscape! http://shopnow.netscape.com/ Get your own FREE, personal Netscape Mail account today at http://webmail.netscape.com/ |
From: <Tin...@Te...> - 2002-04-17 01:46:02
|
Hi, I am seeing a bunch of extra characters inserted between the command I sent. I sent 'copy startup to bootflash:lab-baseline.conf\n', but the string used in matching is: ---- Does `copy \033[?25l\rlab1nnisaa02.lab# copy \015\033[C\033[C\033[C\033[C\033[C\033[C\033[C\033[C\033[C\033[C\033[C\033[C \033[C' Can anyone help explain this Below is the Expect.pm debug output. Thanks. Sending 'copy startup to bootflash:lab-baseline.conf\n' to spawn id(3) Expect::print('Expect=GLOB(0x835d620)', 'copy startup to bootflash:lab-baseline.conf^J') called at first.pl line 34 Starting EXPECT pattern matching... Expect::expect('Expect=GLOB(0x835d620)', 5, 'ARRAY(0x836a338)', '# ') called at first.pl line 38 spawn id(3): list of patterns: #1: -re `.*no.*? ' #2: -ex `# ' spawn id(3): Does `' match: pattern #1: -re `.*no.*? '? No. pattern #2: -ex `# '? No. Waiting for new data (5 seconds)... lab1nnisaa02.lab# copy spawn id(3): Does `copy \033[?25l\rlab1nnisaa02.lab# copy \015\033[C\033[C\033[C\033[C\033[C\033[C\033[C\033[C\033[C\033[C\033[C\033[C \033[C' match: pattern #1: -re `.*no.*? '? No. pattern #2: -ex `# '? YES!! Before match string: `copy \033[?25l\rlab1nnisaa02.lab' Match string: `# ' After match string: `copy \r\033[C\033[C\033[C\033[C\033[C\033[C\033[C\033[C\033[C\033[C\033[C\033[C\0 33[C' Matchlist: () Returning from expect successfully. Sending 'exit\nexit\012' to spawn id(3) Expect::print('Expect=GLOB(0x835d620)', 'exit^Jexit^J') called at first.pl line 41 lab1nnisaa02.lab# copy startup to bootflash:lab-baseline.conf Are you sure you want to overwrite /int-flash/cfg/lab-baseline.conf [no]? exit lab1nnisaa02.lab# exit |
From: Olivier A. <Oli...@if...> - 2002-04-16 15:02:47
|
Hi, I'm new to the list. Thank's to developper's who maintain Expect! I'm trying to exit perl whith an exit code after doing some expect stuff, but the exit code is always set to 1. What I'm doing wrong ? here is my test code: #!/usr/bin/perl -w use strict; use Expect; my $exp=Expect->spawn("csh") or die "error: $!"; print $exp "exit 3"; exit 3; %./test.pl %echo ?$ 1 % Thank's for help! I'm using Expect 1.15 with perl 5.6.0 on both solaris and linux platform. -- Olivier |
From: Nathaniel I. <nd...@bu...> - 2002-04-05 20:39:33
|
On Fri, Apr 05, 2002 at 09:57:39AM +0200, RGi...@a1... wrote: > I added such a 'sleep' statement to all spawns in test.pl and now all > tests pass (except those I added to specifically test for the bug). I rejiggered the GPG module's ten spawn calls, but it's still hanging in the same place, after sysread in spawn() in test 11 (decryption). > Have you tried the Crypt::GPG tests on a different platform? If you > don't have access locally, I can recommend the SourceForge compile > farm. I have an old sourceforge account, and I can log into shell, but my password's rejected when I try to connect to cf.sourceforge.net. I'll file a support request. -nat |