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: Blackstone, J. D. <jda...@ci...> - 2001-11-27 15:07:05
|
> Another way would be to use callbacks, e.g.: > > $exp_obj->expect($timeout, > [ qr"re_pattern" => sub { }], > [ timeout => sub { die "Timeout" }], > [ eof => sub { warn "EOF" }], > ); Thank you! I didn't completely understand that I could do that, because I thought when you passed arrayrefs like that you had to use regexes and couldn't use the timeout/eof keywords. J. David |
From: Roland G. <RGi...@a1...> - 2001-11-27 15:04:05
|
> I'm trying to figure out how to handle a timeout. If I understand > correctly, I can determine if a call to expect() timed out by > examining the > second value in the return value list, e.g.: > > my(undef, $error) = $exp_obj->expect(10, "thisstring"); > > The documentation seems to say that when "thisstring" is not > found in 10 > seconds, $error will contain the string "1:TIMEOUT" . Do I have this > correct? Yes, this is correct. Also, the first return value will be undef. Another way would be to use callbacks, e.g.: $exp_obj->expect($timeout, [ qr"re_pattern" => sub { }], [ timeout => sub { die "Timeout" }], [ eof => sub { warn "EOF" }], ); See the Expect FAQ for an example. Hope this helps, Roland -- RGi...@cp... |
From: Blackstone, J. D. <jda...@ci...> - 2001-11-26 21:13:39
|
I'm trying to figure out how to handle a timeout. If I understand correctly, I can determine if a call to expect() timed out by examining the second value in the return value list, e.g.: my(undef, $error) = $exp_obj->expect(10, "thisstring"); The documentation seems to say that when "thisstring" is not found in 10 seconds, $error will contain the string "1:TIMEOUT" . Do I have this correct? Thanks. J. David Blackstone |
From: Roland G. <RGi...@a1...> - 2001-11-26 09:52:11
|
> I'm doing some mulitline matching of an FTP prompt and I'm having > trouble with a colon (:) in my regex. No, you have troubles with backslashes... > unless ( $pattern = $ftp->expect($timeout, '-re', "550 $list/archive/latest/\*:", "226 Transfer complete.\r\nftp> " )){ Well, if I would be a perl parser, I would think: "Hmm, a string in double quotes... OK, let's substitute... a '$' means a variable substitution... oh, there is a backslash, OK, let's quote the next character, but it isn't a special character, so I just remove the backslash". And later, the regexp engine thinks: "Let's see, it matched everything so far, the next character should be a slash that can occur zero or any number of times... OK, there is one slash... next charcter shoudl be a colon... nope, there is an asterisk there, sorry, no match!". I'd suggest you use qr() or double that backslash. > I don't know where the ^M come from. No doubt, because I am > running cygwin. Maybe, but that could also be just missing CRLF->LF translation in the pty, which is system dependent, so yes, it's Cygwin. > So, it apppears the colon is the problem. But wait! the > after-match string still has the asterisk. I escaped the > asterisk. Do I have to double-escape it? Yes. > -- > Greg Matheson The best jokes are > Chinmin College those you play on > yourself. ^ does the above one count? :-) Hope this helps, Roland -- RGi...@cp... |
From: Greg M. <la...@ms...> - 2001-11-26 08:13:45
|
I'm doing some mulitline matching of an FTP prompt and I'm having trouble with a colon (:) in my regex. The line is: unless ( $pattern = $ftp->expect($timeout, '-re', "550 $list/archive/latest/\*:", "226 Transfer complete.\r\nftp> " )){ die "No conditional on ms archive ls to local file, ".$ftp->error()."\n"; } Actually, I want to map right to the end of the prompt I am trying to match with the first pattern, but the colon (:) is screwing things up. Here is the output from exp_internal: Starting EXPECT pattern matching...^M Expect::expect('Expect=GLOB(0xbb537c)', 10, '-re', '550 namsook-wei-li/ +archive/latest/*:', '226 Transfer complete.^M^Jftp> ') called at ./down.pl +line 69 spawn id(3): list of patterns:^M #1: -re `550 namsook-wei-li/archive/latest/*:'^M #2: -ex `226 Transfer complete.\r\nftp> '^M ^M ^M spawn id(3): Does `'^M match:^M pattern #1: -re `550 namsook-wei-li/archive/latest/*:'? No.^M pattern #2: -ex `226 Transfer complete.\r\nftp> '? No.^M ^M ^M spawn id(3): Does `y\r\n'^M match:^M pattern #1: -re `550 namsook-wei-li/archive/latest/*:'? No.^M pattern #2: -ex `226 Transfer complete.\r\nftp> '? No.^M ^M ^M spawn id(3): Does `y\r\n200 PORT command successful.\r\012'^M match:^M pattern #1: -re `550 namsook-wei-li/archive/latest/*:'? No.^M pattern #2: -ex `226 Transfer complete.\r\nftp> '? No.^M ^M ^M spawn id(3): Does `y\r\n200 PORT command successful.\r\012550 namsook-wei-li/ +archive/latest/*: No such file or directory.\r\012ftp> '^M match:^M pattern #1: -re `550 namsook-wei-li/archive/latest/*:'? No.^M pattern #2: -ex `226 Transfer complete.\r\nftp> '? No.^M ^M No conditional on ms archive ls to local file, 0 I don't know where the ^M come from. No doubt, because I am running cygwin. I thought it might be due to the colon being special in regexes, even though perldoc says they are only after (?: or in POSIX classes, [: etc. So I tried escaping it, but I get the same output from exp_internal. So, I just deleted the colon and tried: unless ( $pattern = $ftp->expect($timeout, '-re', "550 $list/archive/latest/\*", "226 Transfer complete.\r\nftp> " )){ die "No conditional on ms archive ls to local file, ".$ftp->error()."\n"; } Starting EXPECT pattern matching...^M Expect::expect('Expect=GLOB(0xbb537c)', 10, '-re', '550 namsook-wei-li/ +archive/latest/*', '226 Transfer complete.^M^Jftp> ') called at ./down.pl line +69 spawn id(3): list of patterns:^M #1: -re `550 namsook-wei-li/archive/latest/*'^M #2: -ex `226 Transfer complete.\r\nftp> '^M ^M ^M spawn id(3): Does `'^M match:^M pattern #1: -re `550 namsook-wei-li/archive/latest/*'? No.^M pattern #2: -ex `226 Transfer complete.\r\nftp> '? No.^M ^M ^M spawn id(3): Does `y\r\n'^M match:^M pattern #1: -re `550 namsook-wei-li/archive/latest/*'? No.^M pattern #2: -ex `226 Transfer complete.\r\nftp> '? No.^M ^M ^M spawn id(3): Does `y\r\n200 PORT command successful.\r\012'^M match:^M ttern #1: -re `550 namsook-wei-li/archive/latest/*'? No.^M pattern #2: -ex `226 Transfer complete.\r\nftp> '? No.^M ^M ^M spawn id(3): Does `y\r\n200 PORT command successful.\r\012550 namsook-wei-li/ +archive/latest/*: No such file or directory.\r\012ftp> '^M match:^M pattern #1: -re `550 namsook-wei-li/archive/latest/*'? YES!!^M Before match string: `y\r\n200 PORT command successful.\r\012'^M Match string: `550 namsook-wei-li/archive/latest/'^M After match string: `*: No such file or directory.\r\nftp> '^M Matchlist: ()^M So, it apppears the colon is the problem. But wait! the after-match string still has the asterisk. I escaped the asterisk. Do I have to double-escape it? In the lines before this, I am trying to get a listing of files: print $ftp "nlist $list/archive/latest ../ls\r"; unless ($ftp->expect ($timeout, 'output to local-file: ../ls? ')) { die "Nlist question broken, ".$ftp->exp_error()."\n"; } print $ftp "y\r"; I guess this is all academic, because my program is working, but I remember reading in the expect man page about matching right to the end of the prompt, and I would like to do that with the Expect module too. -- Greg Matheson The best jokes are Chinmin College those you play on yourself. Taiwan Penpals Archive <URL: http://netcity.hinet.net/kurage> |
From: Roland G. <RGi...@a1...> - 2001-11-21 16:14:36
|
> I recently installed Perl on my Windows 2000 PC and > wanted to install Expect. I suppose you installed ActiveState Perl, right? Expect doesn't work with that one, it needs the Cygwin environment which provides a more unix-like framework. Find it under <http://sources.redhat.com/cygwin/>. Hope this helps, Roland -- RGi...@cp... |
From: Maloney, G. <ger...@in...> - 2001-11-21 11:41:44
|
Hello I recently installed Perl on my Windows 2000 PC and wanted to install Expect. I download ed IO-Tty.pm from CPan but cannot install it , as I get the following errors( see below). I also tried the Bundle::Expect, but the make file is for Unix. Can someone point me to a Win2K compliant version of expect ? Help is greatly appreciated. G. ############# IO::Tty make errors#### c:\TEMP\IO-Tty-0.05>perl makefile.pl cl' is not recognized as an internal or external command, operable program or batch file. ERROR: cannot run the configured compiler cl Looking for ttyname()... The system cannot find the path specified. Uh oh, I cannot seem to find ttyname() on your system!! Looking for libutil.h... The system cannot find the path specified. ot found. Looking for util.h... The system cannot find the path specified. ot found. Looking for pty.h... The system cannot find the path specified. ot found. ooking for openpty()... The system cannot find the path specified. ot found. DEFINE = checking if your kit is complete... looks good writing Makefile for IO::Tty |
From: Jean-Laurent H. <hu...@ho...> - 2001-11-08 01:13:03
|
Hi There, I'm using Expect to see if a program causes a segfault under certain circumstances. The code I'm using looks like that: $exp->expect(undef, ... several expect match clauses ... [ eof => sub { my $self = shift; $eof = 1; } ], ); my $status = $exp->soft_close(); return ($exp->exitstatus() == 11); That works fine under HPUX 10.20. Unfortunately on HPUX 11.00, $exp->exitstatus() is not defined. I looked at Expect.pm and found that on some condition (2:EOF) the exitstatus value does not get set. If I apply the following diffs to Expect.pm, my code works on HPUX 11.00 as well: 759c759,760 < $exp->hard_close(); --- > my $hard_close_status = $exp->hard_close(); > ${*$exp}{exp_Exit} = $hard_close_status unless ${*$exp}{exp_Exit}; Can you consider including this fix (or a similar one) to the next version of Expect? I can test your fix if you send me a beta version. Thanks, Jean-Laurent Here is some debugging info: ----------------------------------------------------------------- Starting EXPECT pattern matching... Expect::expect('Expect=GLOB(0x402a9e4c)', undef, 'ARRAY(0x402a7b24)', 'ARRAY(0x402a7ce0)', 'ARRAY(0x402a9ef4)', 'ARRAY(0x402a9fa8)') called at test.pl line 191 main::run_passwd(...) called at test.pl line 316 main::test_107() called at test.pl line 382 main::main() called at test.pl line 390 Closing spawn id(4). Expect::hard_close('Expect=GLOB(0x402a9e4c)') called at /usr/local/lib/perl5/site_perl/5.005/Expect.pm line 759 Expect::_multi_expect(undef, undef, 'ARRAY(0x402af9d0)') called at /usr/local/lib/perl5/site_perl/5.005/Expect.pm line 478 Expect::expect('Expect=GLOB(0x402a9e4c)', undef, 'ARRAY(0x402a7b24)', 'ARRAY(0x402a7ce0)', 'ARRAY(0x402a9ef4)', 'ARRAY(0x402a9fa8)') called at test.pl line 191 main::run_passwd(...) called at test.pl line 316 main::test_107() called at test.pl line 382 main::main() called at test.pl line 390 spawn id(4) closed. Pid 17741 of spawn id(4) exited, Status: 11 Closing spawn id(4). Expect::soft_close('Expect=GLOB(0x402a9e4c)') called at test.pl line 193 main::run_passwd(...) called at test.pl line 316 main::test_107() called at test.pl line 382 main::main() called at test.pl line 390 Closing spawn id(4). Expect::hard_close('Expect=GLOB(0x402a9e4c)') called at /usr/local/lib/perl5/site_perl/5.005/Expect.pm line 1485 Expect::DESTROY('Expect=GLOB(0x402a9e4c)') called at test.pl line 324 eval {...} called at test.pl line 324 main::test_107() called at test.pl line 382 main::main() called at test.pl line 390 Pid 17741 of spawn id(4) exited, Status: -1 ----------------------------------------------------------------- Summary of my perl5 (5.0 patchlevel 5 subversion 3) configuration: Platform: osname=hpux, osvers=11.00, archname=PA-RISC1.1 uname='hp-ux disco b.11.00 u 9000800 125901587 unlimited-user license ' hint=recommended, useposix=true, d_sigaction=define usethreads=undef useperlio=undef d_sfio=undef Compiler: cc='gcc', optimize='-O', gccversion=2.9-hppa-991112 cppflags='-D_HPUX_SOURCE -I/usr/local/include -D_FILE_OFFSET_BITS=64 -I/usr/local/include' ccflags ='-D_HPUX_SOURCE -I/usr/local/include -D_FILE_OFFSET_BITS=64 -I/usr/local/include' stdchar='unsigned char', d_stdstdio=define, usevfork=false intsize=4, longsize=4, ptrsize=4, doublesize=8 d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16 alignbytes=8, usemymalloc=n, prototype=define Linker and Libraries: ld='ld', ldflags =' -L/usr/local/lib' libpth=/usr/local/lib /lib /usr/lib /usr/ccs/lib libs=-lnsl -lndbm -ldld -lm -lpthread libc=/usr/lib/libc.sl, so=sl, useshrplib=false, libperl=libperl.a Dynamic Linking: dlsrc=dl_hpux.xs, dlext=sl, d_dlsymun=undef, ccdlflags='-Wl,-E -Wl,-B,deferred ' cccdlflags='-fpic', lddlflags='-b -L/usr/local/lib' Characteristics of this binary (from libperl): Built under hpux Compiled at Jun 12 2001 12:31:36 @INC: /usr/local/lib/perl5/5.00503/PA-RISC1.1 /usr/local/lib/perl5/5.00503 /usr/local/lib/perl5/site_perl/5.005/PA-RISC1.1 /usr/local/lib/perl5/site_perl/5.005 . _________________________________________________________________ Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp |
From: Greg L. <gl...@ey...> - 2001-10-31 04:59:51
|
Hi Roland, On Tue, Oct 30, 2001 at 04:13:20PM +0100, Roland Giersig wrote: > > I'm trying to write a Perl script that will record user input to a > > program to allow that input to be "played" back and fed into the > > program multiple > > times. I'm sure I can do this with Expect, but I'm dropping my clue > > somewhere along the way. I've tried a number of combinations like: > > There is a utility for Tcl/Expect called 'autoexpect' that does this, > maybe you should just port that to perl. The problem with this task is > that you have to determine what the program prompt looks like so you > know when to send the next command. This often means that you have to > put the script together by hand, so you also could just log the session > to a logfile and do that by hand, pasting the appropriate strings into > some send/expect template. Right, autoexpect is exactly the kind of effect I was looking for. Once I have the appropriate program input though I just feed it to the next program invocation with < however, so I don't need to put together an expect/send script with what the user types, just get a hold of it :). > > Any pointers of where I'm going wrong would be greatly appreciated! > > Your code looks good in principle and should work. Have you tried > setting $Expect::Exp_Internal = 1 to see what Expect is doing > internally? $Expect::Debug could also be of help... Thanks. That did help. The problem is that I listen to STDIN using set_group(). Unfortunately the call to interact() does its own set_group() call to get the program listening to STDIN. This clears the listen group I had set up. I tried to bypass this by duplicating some of the interact() code and calling interconnect() directly but without much luck. I ended up just commenting out the clearing of the listen group by set_group, which isn't the right solution, but gets me going. Have you considered an add_group/remove_group set of functions as well as set_group? interact() could then be modified to use that rather than clearing the listen groups with its own set_group calls. regards, Greg -- Greg Lewis Email : gl...@ey... Eyes Beyond Phone : (801) 765 1887 Information Technology Web : http://www.eyesbeyond.com |
From: Roland G. <RGi...@a1...> - 2001-10-30 15:18:58
|
> However, I have encountered issues when sending text in the > session using > Expect's print() (aka send()) method -- it not only writes the > text to the > server, but logs the sent text as well. Since the server echoes > the text, > any text I enter is printed twice -- once when I call print(), and > thenagain when I call expect(). This ends up getting the emulator > out of sync. Noted. This will be fixed in the next version that is due in a few days. I'm attaching a prerelease version, please try it out and see if it's OK for you. Hope this helps, Roland -- RGi...@cp... |
From: Roland G. <RGi...@a1...> - 2001-10-30 15:13:35
|
> I'm trying to write a Perl script that will record user input to a > program to allow that input to be "played" back and fed into the > program multiple > times. I'm sure I can do this with Expect, but I'm dropping my clue > somewhere along the way. I've tried a number of combinations like: There is a utility for Tcl/Expect called 'autoexpect' that does this, maybe you should just port that to perl. The problem with this task is that you have to determine what the program prompt looks like so you know when to send the next command. This often means that you have to put the script together by hand, so you also could just log the session to a logfile and do that by hand, pasting the appropriate strings into some send/expect template. > Any pointers of where I'm going wrong would be greatly appreciated! Your code looks good in principle and should work. Have you tried setting $Expect::Exp_Internal = 1 to see what Expect is doing internally? $Expect::Debug could also be of help... Hope this helps, Roland -- RGi...@cp... |
From: Chris R. D. <cdo...@dm...> - 2001-10-29 17:47:39
|
Hi all, I am developing a script that must navigate a form on a legacy system that sends VT100 terminal codes. I have to perform a lot of screen-based checks, so in addition to using Expect to handle most of the dirty work, I am also using the Term::VT102 class to handle the "screen scraping" part of it by using Expect::log_file() to send the data to a Term::VT102 object, which then parses the data and creates the "screen" in memory. However, I have encountered issues when sending text in the session using Expect's print() (aka send()) method -- it not only writes the text to the server, but logs the sent text as well. Since the server echoes the text, any text I enter is printed twice -- once when I call print(), and then again when I call expect(). This ends up getting the emulator out of sync. I have come up with a workaround by calling IO::Tty::print() on the Expect object, which is done inside Expect::print() to send the text to the tty after it does the local echo. However, I was wondering if a setting to turn off this Expect-level local echo (as there is with disabling local echo in the stty itself) could be added? Thanks, # Chris ______________________________________________________________________ Chris Donnelly cdo...@dm... Software Systems Architect Digital Motorworks Austin, TX (512) 692-1101 |
From: Greg L. <gl...@ey...> - 2001-10-27 15:58:48
|
Hi Simon, On Sat, Oct 27, 2001 at 08:43:05AM -0700, Simon Taylor wrote: > > In the above attempt, the file "foo.$$" is empty. > > > > Any pointers of where I'm going wrong would be greatly appreciated! > > In the example you supplied, the FOO filehandle is not being closed. Is this > also the case in your real code? That would be one possible cause of the > symptoms you're describing. No, I do close FOO in the code itself. I just posted a snippet, which didn't include the close, sorry. regards, Greg -- Greg Lewis Email : gl...@ey... Eyes Beyond Phone : (801) 765 1887 Information Technology Web : http://www.eyesbeyond.com |
From: Simon T. <si...@un...> - 2001-10-27 15:44:35
|
Hello Greg, > In the above attempt, the file "foo.$$" is empty. > > Any pointers of where I'm going wrong would be greatly appreciated! In the example you supplied, the FOO filehandle is not being closed. Is this also the case in your real code? That would be one possible cause of the symptoms you're describing. Regards, Simon Taylor |
From: Greg L. <gl...@ey...> - 2001-10-27 05:45:52
|
Hi all, I'm trying to write a Perl script that will record user input to a program to allow that input to be "played" back and fed into the program multiple times. I'm sure I can do this with Expect, but I'm dropping my clue somewhere along the way. I've tried a number of combinations like: # Open an external file to listen on. open(FOO, ">foo.$$"); select((select(FOO),$|=1)[0]); my $external = Expect->exp_init(\*FOO); # Spawn an external command and interact my $stdin = Expect->exp_init(\*STDIN); $stdin->set_group($external); my $expect = Expect->spawn('some program'); $expect->debug(2); $expect->interact($stdin); with no success. In the above attempt, the file "foo.$$" is empty. Any pointers of where I'm going wrong would be greatly appreciated! -- Greg Lewis Email : gl...@ey... Eyes Beyond Phone : (801) 765 1887 Information Technology Web : http://www.eyesbeyond.com |
From: Rogaski, M. A. <ro...@at...> - 2001-10-17 16:59:43
|
: -----Original Message----- : From: Andreas Lidberg, Halmstad Internet AB [mailto:an...@hi...] : : If anyone has working sourcecode to initiate the modem and so : the dialup I : can probably figure out the rest by myself. : There was a decent article on using Win32::SerialPort for this purpose in issue #13 of The Perl Journal. However, the Device::SerialPort looks like it will allow you do the same thing about as easily on a UN*X platform. Some good pointers are available at: http://members.aol.com/Bbirthisel/alpha.html 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: Roland G. <RGi...@a1...> - 2001-10-17 13:10:57
|
From=3A =22Andreas Lidberg=2C Halmstad Internet AB=22 =3Candreas=40hinet=2E= nu=3E =3E I am writing a system for controlling the status of our network = =3E (usingamong other things Net=3A=3ASNMP)=2E When something doesn=B4t r= eply = =3E as expected I want the system to send us (admins) a SMS with =3E an errormessage=2E=2E=2E =3E = =3E Now to the problem=3A =3E = =3E I am very new to Perl and actually to Unix/Linux in general and I = =3E am in need of some help=2E =3E I have NO idea of how to access the modem to do a dialup to a SMS = =3E Server and =3E to send the message=2E I do know how the message is supposed to look = =3E when sent =3E but I don=B4t know how to communicate with the modem=2E =3E = =3E I have gotten so far as to guess that IO=3A=3Aptty could be the right= = =3E way to walk=2C so thats why I am posting here=2E Well=2C actually you would want to use Expect to spawn an external modem = terminal program (typically =27tip=27) and let it handle communications = over the modem=2E Unfortunately I don=27t have any experience with modem= = dialup=2C so I cannot suggest something=2C you have to find out by yourse= lf = or continue asking around=2E What you need to do is to do it once manually and then write an Expect = script to repeat it=2E You start the program and take note what possible= = prompts you get=2E You type a sequence of characters and watch for the = systems answer=2C etc=2E Then you put that into a script using spawn()=2C= = send() and expect()=2E Now if you wanted to send the SMS via a webpage=2C that=27s something I = already have done and could give you a code example=2E=2E=2E Hope this helps=2C Roland -- RGiersig=40cpan=2Eorg |
From: Andreas L. H. I. A. <an...@hi...> - 2001-10-17 12:31:42
|
Hi there to all the wizards of Perl! I am writing a system for controlling the status och our network (using among other things Net::SNMP). When something doesn=B4t reply as expected= I want the system to send us (admins) a SMS with an errormessage... Now to the problem: I am very new to Perl and actually to Unix/Linux in general and I am in n= eed of some help. I have NO idea of how to access the modem to do a dialup to a SMS Server = and to send the message. I do know how the message is supposed to look when s= ent but I don=B4t know how to communicate with the modem. I have gotten so far as to guess that IO::ptty could be the right way to walk, so thats why I am posting here. If anyone has working sourcecode to initiate the modem and so the dialup = I can probably figure out the rest by myself. Sincerely Andreas Lidberg |
From: Roland G. <RGi...@CP...> - 2001-09-29 18:37:02
|
Hoang Ngo wrote: > - Spawn a telnet session into a term server (DigiBoard 8 ports) and obtain > a object handle from that. > > At this point, what happens to my STDIN, STDOUT? How can i print > to the screen that i started the script. Expect gives you a separate file handle for communicationg with the spawned program, so your STDIN and STDOUT are unchanged. The spawned telnets STDIN and STDOUT are connected to the filehandle that Expect->spawn returns, so you send a string to telnet by printing to the returned handle. > - Goes through the normal login procedure with user name and such > - Enter a forever loop. In this loop > get input from keyboard. $command=<stdin> > If the command is one that the script understands - process it > else send the command to the UUT (unit under test), capture the out > put from the command and wait for prompt. > > At this point, i encountered a few problems with capturing the output > of the UUT. Not all the output of the UUT is captured regardless of variations > that i tried. Is it possible that the output of UUT is buffered somewhere? in > Expect? in Xterm? I don't have this problem if i go into interactive mode > ($object->interact()). It would help if you post your code. It might be just a slight semantical misunderstanding or a wrong regexp. > If you have done somthing like this before please drop me a line. Yes, I have written a regression testsuite that does something similar. Hope this helps, Roland -- RGi...@cp... |
From: Hoang N. <hoa...@pl...> - 2001-09-24 17:36:07
|
Hello - I just started using Perl 5 and Expect-1.12 and have a problem with obtaining output from a spawned process. Much appreciate if you could point out a few things for me. Here is the basic steps of the program: - Spawn a telnet session into a term server (DigiBoard 8 ports) and obtain a object handle from that. At this point, what happens to my STDIN, STDOUT? How can i print to the screen that i started the script. - Goes through the normal login procedure with user name and such - Enter a forever loop. In this loop get input from keyboard. $command=<stdin> If the command is one that the script understands - process it else send the command to the UUT (unit under test), capture the out put from the command and wait for prompt. At this point, i encountered a few problems with capturing the output of the UUT. Not all the output of the UUT is captured regardless of variations that i tried. Is it possible that the output of UUT is buffered somewhere? in Expect? in Xterm? I don't have this problem if i go into interactive mode ($object->interact()). If you have done somthing like this before please drop me a line. Thanks in advance, Hoang |
From: Roland G. <RGi...@CP...> - 2001-09-08 22:28:45
|
Finally! A much improved version of IO::Tty that now even works under Cygwin, which means: (tada!) Expect for Windows! Only a few very basic tests have been done, so I expect that further bugfixes may be needed, but it's still a small giant step... Find attached the READMEs for IO::Tty and Expect. Note that I have enhanced documentation, especially for Expect. Both modules are available from CPAN. Feedback is (as always) appreciated. Roland -- RGi...@cp... IO::Tty v0.05 ============= IO::Tty and IO::Pty provide an interface to pseudo tty's To build this distribution run perl Makefile.PL make make test make install There is finally a 'make test' for this distribution!! For manual tests there is still a script included called 'try'. If try is run with arguments it will run then as a command with the output connected via a pseudo tty, eg perl -Mblib try ls This module was developed by Graham Barr <gb...@po...> and is now maintained by Roland Giersig <RGi...@cp...>. GREAT NEWS!! It now works on Windows under Cygwin (http://source.redhat.com/cygwin) !! For all those interested: Cygwin provides /dev/ptmx semantics, but there is no actual file called '/dev/ptmx'. Still, when someone opens it, Cygwin emulates the Right Thing (tm). Deep Magic! It should finally work with HPUX 11.0 and FreeBSD, but I cannot do any in-depth testing, so please provide feedback. Please note that pty creation is very system-dependend. If you have problems on your system, please send me (<RGi...@cp...>) the output of a manual installation ('perl Makefile.PL; make; make test;') and I'll see what I can deduce from it. Supported systems include Linux, Solaris, AIX, OSF, *BSD, HP-UX and finally Windows (under the Cygwin environment, see http://source.redhat.com/cygwin). See the IO::Tty manpage for a list. If it's working on your system, please send me a short note with details (version number, distribution, etc. 'uname -a' is a good start) so I can get an overview. Thanks! As this module is mainly used by Expect, support for it is available via the two Expect mailing lists, expectperl-announce and expectperl-discuss, at http://lists.sourceforge.net/lists/listinfo/expectperl-announce and http://lists.sourceforge.net/lists/listinfo/expectperl-discuss Thanks to (in no particular order) Mark Montague <mar...@um...> Olaf Flebbe <o.f...@sc...> Nick Scott <Nic...@ve...> Theo Petersen <th...@ac...> Rocco Caputo <tr...@ne...> Dave Smith <dav...@ca...> Bob Showalter <Bob...@ta...> who helped fixing bugs on various platforms. See the ChangeLog for details. Roland <RGi...@cp...> 2001-08-16 Expect.pm v1.12 =============== GREAT NEWS! Expect should finally work under the cywin environment for Windows NT! All you need is the latest version of IO::Tty (0.05), which has been severely enhanced and bugfixed. Also, *BSD and HPUX should work now. Please refer to the IO::Tty documentation. Expect requires IO::Tty and IO::Stty, also available from CPAN. It is highly recommended that you also upgrade to the latest IO::Tty. There is a Bundle::Expect available that installs everything for you. If you prefer manual installation, the usual perl Makefile.PL make make test make install should work. I finally started a simple testsuite for Expect, but it doesn't really test anything deeper right now. The problem is to find some external program to use for generating reproducible output that is available across all platforms. Luckily, we can always use perl itself... Contributions to the testsuite are of course welcome. It would probably be wise to read the docs on IO::Tty before doing a make install with it (or at least when there are problems). Note that IO::Tty is very system-dependend. I'm in the process to steal the pty-creation code from the Tcl version of Expect, which should be much more stable, but this may take a while (no free tuits at the moment). The Expect for Perl module was inspired more by the functionality the Tcl tool provides than any previous Expect-like tool such as Comm.pl or chat2.pl. The Tcl version of expect is a creation of Don Libes (li...@ni...). The Tcl Expect home page is http://expect.nist.gov/. Don has written an excellent in-depth tutorial of Tcl/Expect, which is _Exploring Expect_. It is the O'reilly book with the monkey on the front. Don has several references to other articles on the Expect web page. I try to stay as close to Tcl/Expect in interface and semantics as possible (so I can refer questions to the Tcl/Expect docu). Suggestions for improvement are always welcome. There is now a FAQ section in the pod, complete with examples, so please let me know if there's something you'd like to see answered there that isn't. There are two mailing lists available, expectperl-announce and expectperl-discuss, at http://lists.sourceforge.net/lists/listinfo/expectperl-announce and http://lists.sourceforge.net/lists/listinfo/expectperl-discuss From the Changes file: ====================== ! exp_Max_Accum didn't work for interact. - removed soft_close() from DESTROY. Being overly nice to a doomed process doesn't pay off. Old behaviour is available via $Expect::Do_Soft_Close = 1; ! cleanup of log and exp_internal output + added various aliases for functions starting with 'exp_' ! moved FAQ and intro into the main pod as I got the impression that many users didn't bother to read all the documentation or didn't know that it was there. + added a hook for log_file: can be set to a code ref. Thanks to everybody who wrote to me, either with bug reports or enhancement suggestions! Roland Giersig (maintainer of Expect.pm, IO::Pty, IO::Stty, Tie::Persistent) RGi...@cp... 2001-09-03 |
From: Kenneth G. <ke...@pe...> - 2001-08-14 02:17:25
|
Roland, Thanks for sending v1.12-pre2. Much more better! I know I've just started using the Expect module a couple of weeks ago and now I am much more familiar with it. It now closes an expect object fast! I had resorted to having to do system(exit)'s or kill expect object by the spawned pid number, etc. Not anymore. Actually had to put in a couple of sleep's to slow it down a hair (which I'd rather do). Keep up the good work, this is a great module, I've several projects ahead that this will work quite well for. I'll be hanging onto the list to keep abreast of any changes. |
From: Roland G. <r.g...@xs...> - 2001-08-13 16:51:44
|
> Anyway I'm using v1.11, I've noticed in the pre-release v1.12 > Roland says something about taking care of how long it takes > to destroy and expect object. Where can I get a copy of v1.12 > to try? From the mailinglist archives? I'm attaching it again... Roland |
From: Kenneth G. <ke...@pe...> - 2001-07-28 23:59:46
|
I know Rolands on vacation for 2 weeks but if there is anyone out there that could help. I've just started using Expect.pm for the first time so it's taking some time. The main problem I'm having with Expect.pm (or more than likely my code) is the time it is taking to destroy/close and return. Takes about 15 sec once the expect "exec ls>test.txt &\r" is given. I've tried with other programs/commands as well. I'm either missing something or this is normal for Expect. The code below is just a test/learning script, it's using a Pty but the time thing doesn't matter with or without using a Pty. Believe me I've read and re-read everything I could find on Expect.pm, I've tweaked with this little sample script till my mind goes numb. I think I've tried every possible way of doing this. Anyway I'm using v1.11, I've noticed in the pre-release v1.12 Roland says something about taking care of how long it takes to destroy and expect object. Where can I get a copy of v1.12 to try? ######################################### #!/usr/bin/perl use Expect; use IO::Pty; require POSIX; $pty = new IO::Pty; POSIX::setsid(); my $tty = $pty->slave; open(STDIN, "<&".fileno($tty)); open(STDOUT,">&".fileno($tty)); open(STDERR,">&STDOUT"); #will prompt for this later. my $password = "xxxxxx\r"; my $prompt = '[\]\$\>\#]\s$'; my $command = Expect->spawn("su"); $command->log_file("log", "w"); ################################################### #$command->expect(10, # [ '-re', 'word:\s$', # sub { print $command->send("$password\r"); # exp_continue; } ], # # [ '-re',$prompt, # sub { print $command->send("exec ls>test.txt &\r"); # } ], # ); ####################################################### $command->expect(10, '-re', 'word:\s$'); print $command "$password\r"; $command->expect(10,'-re',$prompt); print $command "exec ls>test.txt &\r"; ################################################### close($tty); TIA |
From: Roland G. <r.g...@xs...> - 2001-07-25 11:42:42
|
gl...@ma... wrote: > I tried the change to the exec in Expect. Didn't help. Well, it helped insofar as you now can spawn pipe commands, right? > Currently I am getting this: > > Reached end of medium for /dev/nrmt1h; Please wait for file closing > Cannot prompt (can't open /dev/tty): No such device or address Hmm, this sounds bad. 'dd' is trying to read a user response via /dev/tty, over which Expect doesn't have control. interconnect() cannot help here, because as long as 'dd' is reading from stdin, it has to open /dev/tty for a user respone. [earlier programs tried to read from stderr, and this even worked, on some systems... :-) ] Workaround: don't pipe directly into 'dd', use an intermediate file and spawn 'dd' separately. Disadvantage: you need enough harddiskspace. Workaround for that: a named pipe: 'rsh ... > named_pipe' and 'dd if=named_pipe of=/dev/tape' That way, 'dd's stdin stays available for user responses. I do hope that 'dd' is then using stdin and not stubbornly trying to open /dev/tty, otherwise you've got a real problem. > expect is catching the "Press RETURN ..." message, and happily changing > tapes, but the > > print $bakupcmdobj "\r"; > > which I do after the tape is ready is evidently failing. Yes, because it goes to stdin and not to /dev/tty. Hope this helps, Roland PS: Starting tomorrow, I'm off for summer vacation for two weeks. |