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: Zhisong J. <jj...@dy...> - 2004-10-18 20:14:51
|
Austin: thank you for the reply. since I wasn't able to figure out how to make it work under perl 5.8.4. I'm now trying to use SUN's version of perl 5.005_03 came with solaris 9. solaris 9, perl 5.005_03 ,and IO-Tty-1.02 from sourceforge. however, make on IO-Tty-1.02 gives [jason@flounder IO-Tty-1.02]$ make <snip> cc -c -xO3 -xdepend -DVERSION=\"1.02\" -DXS_VERSION=\"1.02\" -KPIC -I/usr/perl5/5.00503/sun4-solaris/CORE -DHAVE_DEV_PTMX -DHAVE_GRANTPT -DHAVE_PTSNAME -DHAVE_SIGACTION -DHAVE_STRLCPY -DHAVE_SYS_STROPTS_H -DHAVE_TERMIOS_H -DHAVE_TERMIO_H -DHAVE_TTYNAME -DHAVE_UNLOCKPT Tty.c cc: unrecognized option `-KPIC' cc: language depend not recognized cc: Tty.c: linker input file unused because linking not done Running Mkbootstrap for IO::Tty () chmod 644 Tty.bs LD_RUN_PATH="" cc -o blib/arch/auto/IO/Tty/Tty.so -G Tty.o cc: Tty.o: No such file or directory cc: no input files make: *** [blib/arch/auto/IO/Tty/Tty.so] Error 1 I believe the sun own version of perl is compiled with sun's own c compiler. does that causing this problm, any work around? Thanks. Jason PS: I also tried to compile perl 5.005_03 from source using gcc 3.3.2 on solaris 9. I got an [jason@flounder perl5.005_03]$ make make: *** No rule to make target `<built-in>', needed by `miniperlmain.o'. Stop. On Fri, 2004-10-08 at 16:48, Austin Schutz wrote: > On Fri, Oct 08, 2004 at 11:28:37AM +0200, Roland Giersig wrote: > > > > Hmm, in the 'perl Makefile.PL' step I'm trying to figure out what > > constants are defined by compiling test progs for each constant. Austin, > > as you seem to have a solaris machine on your hands, could you look into > > that and see why it gets defined? > > > > On my solaris machine I'm not able to replicate the issue because > I'm running an old perl: 5.00503, which doesn't exhibit this problem and > I can't get 5.8.4 to compile. > However, I _was_ able to replicate this on my home linux workstation > by commenting out #define TIOCSCTTY in /usr/include/asm/ioctls.h. > > I'm not sure why the code in question is being executed. Running > it in the debugger I still couldn't figure it out (output follows). It looks > to me like a perl bug. However, I was able to work around it by changing line > 118 to: > > if (defined TIOCSCTTY && TIOCSCTTY) { > > which _should_ be valid - I doubt any vendor defines TIOCSCTTY as 0. > > Austin > > DB<5> p defined TIOCSCTTY > > DB<6> l > 118==> if (defined TIOCSCTTY) { > 119: if (not defined ioctl( ${*$self}{'io_pty_slave'}, TIOCSCTTY, 0 )) { > 120: warn "warning: TIOCSCTTY failed, slave might not be set as control > ling terminal: $!" if $^W; > 121 } > 122 } elsif (defined TCSETCTTY) { > 123: if (not defined ioctl( ${*$self}{'io_pty_slave'}, TCSETCTTY, 0 )) { > 124: warn "warning: TCSETCTTY failed, slave might not be set as control > ling terminal: $!" if $^W; > 125 } > 126 } > 127 > DB<6> s > IO::Pty::make_slave_controlling_terminal(/root/.cpan/build/IO-Tty-1.02/blib/lib/ > IO/Pty.pm:119): > 119: if (not defined ioctl( ${*$self}{'io_pty_slave'}, TIOCSCTTY, 0 )) { > DB<6> p defined TIOCSCTTY > > DB<7> p defined TIOCSCTTY > > DB<8> if(defined TIOCSCTTY) { print "defined\n"; } > > DB<9> n > IO::Pty::make_slave_controlling_terminal(/root/.cpan/build/IO-Tty-1.02/blib/lib/IO/Pty.pm:119): > 119: if (not defined ioctl( ${*$self}{'io_pty_slave'}, TIOCSCTTY, 0 )) { > DB<9> n > Use of uninitialized value in ioctl at /root/.cpan/build/IO-Tty-1.02/blib/lib/IO/Pty.pm line 119, <XT> line 1. > IO::Pty::make_slave_controlling_terminal('IO::Pty=GLOB(0x8171f8c)') called at test.pl line 66 > IO::Pty::make_slave_controlling_terminal(/root/.cpan/build/IO-Tty-1.02/blib/lib/IO/Pty.pm:120): > 120: warn "warning: TIOCSCTTY failed, slave might not be set as controlling terminal: $!" if $^W; > |
From: Zhisong J. <jj...@dy...> - 2004-10-13 15:00:44
|
Helo, I make the change at line 118 as suggeted. however it didn't work. Do you know where can I find or download perl 5.00503 for solaris 9. Thank you very much . Jason On Fri, 2004-10-08 at 16:48, Austin Schutz wrote: > On Fri, Oct 08, 2004 at 11:28:37AM +0200, Roland Giersig wrote: > > > > Hmm, in the 'perl Makefile.PL' step I'm trying to figure out what > > constants are defined by compiling test progs for each constant. Austin, > > as you seem to have a solaris machine on your hands, could you look into > > that and see why it gets defined? > > > > On my solaris machine I'm not able to replicate the issue because > I'm running an old perl: 5.00503, which doesn't exhibit this problem and > I can't get 5.8.4 to compile. > However, I _was_ able to replicate this on my home linux workstation > by commenting out #define TIOCSCTTY in /usr/include/asm/ioctls.h. > > I'm not sure why the code in question is being executed. Running > it in the debugger I still couldn't figure it out (output follows). It looks > to me like a perl bug. However, I was able to work around it by changing line > 118 to: > > if (defined TIOCSCTTY && TIOCSCTTY) { > > which _should_ be valid - I doubt any vendor defines TIOCSCTTY as 0. > > Austin > > DB<5> p defined TIOCSCTTY > > DB<6> l > 118==> if (defined TIOCSCTTY) { > 119: if (not defined ioctl( ${*$self}{'io_pty_slave'}, TIOCSCTTY, 0 )) { > 120: warn "warning: TIOCSCTTY failed, slave might not be set as control > ling terminal: $!" if $^W; > 121 } > 122 } elsif (defined TCSETCTTY) { > 123: if (not defined ioctl( ${*$self}{'io_pty_slave'}, TCSETCTTY, 0 )) { > 124: warn "warning: TCSETCTTY failed, slave might not be set as control > ling terminal: $!" if $^W; > 125 } > 126 } > 127 > DB<6> s > IO::Pty::make_slave_controlling_terminal(/root/.cpan/build/IO-Tty-1.02/blib/lib/ > IO/Pty.pm:119): > 119: if (not defined ioctl( ${*$self}{'io_pty_slave'}, TIOCSCTTY, 0 )) { > DB<6> p defined TIOCSCTTY > > DB<7> p defined TIOCSCTTY > > DB<8> if(defined TIOCSCTTY) { print "defined\n"; } > > DB<9> n > IO::Pty::make_slave_controlling_terminal(/root/.cpan/build/IO-Tty-1.02/blib/lib/IO/Pty.pm:119): > 119: if (not defined ioctl( ${*$self}{'io_pty_slave'}, TIOCSCTTY, 0 )) { > DB<9> n > Use of uninitialized value in ioctl at /root/.cpan/build/IO-Tty-1.02/blib/lib/IO/Pty.pm line 119, <XT> line 1. > IO::Pty::make_slave_controlling_terminal('IO::Pty=GLOB(0x8171f8c)') called at test.pl line 66 > IO::Pty::make_slave_controlling_terminal(/root/.cpan/build/IO-Tty-1.02/blib/lib/IO/Pty.pm:120): > 120: warn "warning: TIOCSCTTY failed, slave might not be set as controlling terminal: $!" if $^W; > > > > ------------------------------------------------------- > This SF.net email is sponsored by: IT Product Guide on ITManagersJournal > Use IT products in your business? Tell us what you think of them. Give us > Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more > http://productguide.itmanagersjournal.com/guidepromo.tmpl > _______________________________________________ > Expectperl-discuss mailing list > Exp...@li... > https://lists.sourceforge.net/lists/listinfo/expectperl-discuss > |
From: Austin S. <te...@of...> - 2004-10-08 20:48:30
|
On Fri, Oct 08, 2004 at 11:28:37AM +0200, Roland Giersig wrote: > > Hmm, in the 'perl Makefile.PL' step I'm trying to figure out what > constants are defined by compiling test progs for each constant. Austin, > as you seem to have a solaris machine on your hands, could you look into > that and see why it gets defined? > On my solaris machine I'm not able to replicate the issue because I'm running an old perl: 5.00503, which doesn't exhibit this problem and I can't get 5.8.4 to compile. However, I _was_ able to replicate this on my home linux workstation by commenting out #define TIOCSCTTY in /usr/include/asm/ioctls.h. I'm not sure why the code in question is being executed. Running it in the debugger I still couldn't figure it out (output follows). It looks to me like a perl bug. However, I was able to work around it by changing line 118 to: if (defined TIOCSCTTY && TIOCSCTTY) { which _should_ be valid - I doubt any vendor defines TIOCSCTTY as 0. Austin DB<5> p defined TIOCSCTTY DB<6> l 118==> if (defined TIOCSCTTY) { 119: if (not defined ioctl( ${*$self}{'io_pty_slave'}, TIOCSCTTY, 0 )) { 120: warn "warning: TIOCSCTTY failed, slave might not be set as control ling terminal: $!" if $^W; 121 } 122 } elsif (defined TCSETCTTY) { 123: if (not defined ioctl( ${*$self}{'io_pty_slave'}, TCSETCTTY, 0 )) { 124: warn "warning: TCSETCTTY failed, slave might not be set as control ling terminal: $!" if $^W; 125 } 126 } 127 DB<6> s IO::Pty::make_slave_controlling_terminal(/root/.cpan/build/IO-Tty-1.02/blib/lib/ IO/Pty.pm:119): 119: if (not defined ioctl( ${*$self}{'io_pty_slave'}, TIOCSCTTY, 0 )) { DB<6> p defined TIOCSCTTY DB<7> p defined TIOCSCTTY DB<8> if(defined TIOCSCTTY) { print "defined\n"; } DB<9> n IO::Pty::make_slave_controlling_terminal(/root/.cpan/build/IO-Tty-1.02/blib/lib/IO/Pty.pm:119): 119: if (not defined ioctl( ${*$self}{'io_pty_slave'}, TIOCSCTTY, 0 )) { DB<9> n Use of uninitialized value in ioctl at /root/.cpan/build/IO-Tty-1.02/blib/lib/IO/Pty.pm line 119, <XT> line 1. IO::Pty::make_slave_controlling_terminal('IO::Pty=GLOB(0x8171f8c)') called at test.pl line 66 IO::Pty::make_slave_controlling_terminal(/root/.cpan/build/IO-Tty-1.02/blib/lib/IO/Pty.pm:120): 120: warn "warning: TIOCSCTTY failed, slave might not be set as controlling terminal: $!" if $^W; |
From: Roland G. <RGi...@cp...> - 2004-10-08 09:53:37
|
I'm asked to approve each and every mail to the list, even from members, though I don't have moderation activated. Strange... |
From: Roland G. <RGi...@cp...> - 2004-10-08 09:29:21
|
Austin Schutz wrote: > On Tue, Oct 05, 2004 at 02:43:42PM -0400, Zhisong Jin wrote: > >>I'm trying to build a Expect.pm on solaris 9 >> >>1. download expect-1.15 and IO-tty-1.02 source from sourceforge >>2. compile and install IO-tty , all OK, \ >>2. compile expect-1.15, failed at make test >>$ perl Makefile.pl >>$ make >>$ make test >> >>"make test failed" , complain about >> >>Use of uninitialized value in ioctl at >>/usr/local/lib/perl5/site_perl/5.8.4/sun4-solaris-thread-multi-64/IO/Pty.pm line 119. >>warning: TIOCSCTTY failed, slave might not be set as controlling >>terminal: Invalid argument at >>/usr/local/lib/perl5/site_perl/5.8.4/sun4-solaris-thread-multi-64/IO/Pty.pm line 120. >>TIMEOUT >> >>looking into the source on Pty.pm , the relevent portion is: >># Acquire a controlling terminal if this doesn't happen automatically >> if (defined TIOCSCTTY) { >> if (not defined ioctl( ${*$self}{'io_pty_slave'}, TIOCSCTTY, 0 )) { >> warn "warning: TIOCSCTTY failed, slave might not be set as >>controlling >>terminal: $!" if $^W; >> } > > > Solaris doesn't set TIOCSCTTY here (can't find it anywhere under > /usr/include), that seems a little strange to me, not sure how you are getting > it defined. > > >> } elsif (defined TCSETCTTY) { > > > Also doesn't define this. > > > I'm looking at 5.8 (vs. 9/5.9), but I would be _very_ surprised if they > changed basic terminal handling code between OS revs. > Hmm, in the 'perl Makefile.PL' step I'm trying to figure out what constants are defined by compiling test progs for each constant. Austin, as you seem to have a solaris machine on your hands, could you look into that and see why it gets defined? Thanks! Roland |
From: Austin S. <te...@of...> - 2004-10-08 09:07:04
|
On Fri, Sep 17, 2004 at 06:41:35AM -0700, David Bellizzi wrote: > > Hey all, > In my log file I'm getting a lot of ^M chars and it seems that size is is > set to 80 chars. Whats the best way to get rid of this so I don't see > excessive white space and my long command lines are visible? > stty cols would probably be the way, but since it's a non-posix terminal extension (don't ask) you probably have to fool with it as you spawn your process, e.g.: $logfile_reader = Expect->spawn("stty cols 0; cat $logfile"); That _should_ work. I'm not sure if 0 means undefined everywhere, but it probably does. Austin |
From: Austin S. <te...@of...> - 2004-10-08 08:54:04
|
On Tue, Oct 05, 2004 at 02:43:42PM -0400, Zhisong Jin wrote: > I'm trying to build a Expect.pm on solaris 9 > > 1. download expect-1.15 and IO-tty-1.02 source from sourceforge > 2. compile and install IO-tty , all OK, \ > 2. compile expect-1.15, failed at make test > $ perl Makefile.pl > $ make > $ make test > > "make test failed" , complain about > > Use of uninitialized value in ioctl at > /usr/local/lib/perl5/site_perl/5.8.4/sun4-solaris-thread-multi-64/IO/Pty.pm line 119. > warning: TIOCSCTTY failed, slave might not be set as controlling > terminal: Invalid argument at > /usr/local/lib/perl5/site_perl/5.8.4/sun4-solaris-thread-multi-64/IO/Pty.pm line 120. > TIMEOUT > > looking into the source on Pty.pm , the relevent portion is: > # Acquire a controlling terminal if this doesn't happen automatically > if (defined TIOCSCTTY) { > if (not defined ioctl( ${*$self}{'io_pty_slave'}, TIOCSCTTY, 0 )) { > warn "warning: TIOCSCTTY failed, slave might not be set as > controlling > terminal: $!" if $^W; > } Solaris doesn't set TIOCSCTTY here (can't find it anywhere under /usr/include), that seems a little strange to me, not sure how you are getting it defined. > } elsif (defined TCSETCTTY) { Also doesn't define this. I'm looking at 5.8 (vs. 9/5.9), but I would be _very_ surprised if they changed basic terminal handling code between OS revs. Austin |
From: Zhisong J. <jj...@dy...> - 2004-10-05 18:43:57
|
I'm trying to build a Expect.pm on solaris 9 1. download expect-1.15 and IO-tty-1.02 source from sourceforge 2. compile and install IO-tty , all OK, \ 2. compile expect-1.15, failed at make test $ perl Makefile.pl $ make $ make test "make test failed" , complain about Use of uninitialized value in ioctl at /usr/local/lib/perl5/site_perl/5.8.4/sun4-solaris-thread-multi-64/IO/Pty.pm line 119. warning: TIOCSCTTY failed, slave might not be set as controlling terminal: Invalid argument at /usr/local/lib/perl5/site_perl/5.8.4/sun4-solaris-thread-multi-64/IO/Pty.pm line 120. TIMEOUT looking into the source on Pty.pm , the relevent portion is: # Acquire a controlling terminal if this doesn't happen automatically if (defined TIOCSCTTY) { if (not defined ioctl( ${*$self}{'io_pty_slave'}, TIOCSCTTY, 0 )) { warn "warning: TIOCSCTTY failed, slave might not be set as controlling terminal: $!" if $^W; } } elsif (defined TCSETCTTY) { if (not defined ioctl( ${*$self}{'io_pty_slave'}, TCSETCTTY, 0 )) { warn "warning: TCSETCTTY failed, slave might not be set as controlling terminal: $!" if $^W; } } can somebody suggest a work around or is there exist a solution? thanks. Jason |
From: David B. <dbe...@an...> - 2004-09-17 13:32:15
|
Hey all, In my log file I'm getting a lot of ^M chars and it seems that size is is set to 80 chars. Whats the best way to get rid of this so I don't see excessive white space and my long command lines are visible? Thanks in advance db |
From: Austin S. <te...@of...> - 2004-09-02 18:58:40
|
On Thu, Sep 02, 2004 at 02:14:16PM -0400, Ke...@sg... wrote: > Hi Austin, > > Is there any Expect Perl module for Windows platform? I would very > appreciate your reply. > > Thank you, > I've just successfully built this under cygwin and ran successful tests with it, installing via CPAN using 'perl -MCPAN -eshell' and "install Expect" command. There are a couple caveats: 1. Your home directory must not have a space in it or CPAN will get heavily confused. You can change this after running mkpasswd from the cygwin shell by editing /etc/passwd. 2. You have to install gcc with cygwin, because IO::Tty contains C extensions. 3. It doesn't appear to play nicely with native windows terminal driven software, such as ftp.exe, though perhaps some amount of cleverness could help. It seems to work fine with cygwin stuff, such as /usr/bin/ftp. hth, Austin |
From: Roee F. <Roe...@mo...> - 2004-07-18 12:02:46
|
Hello! =20 Sorry if what I ask is FAQ, or simple, I'm totally newbie WRT Expect. =20 I have a script which runs from a Linux computer, connects to a windows computer via nc, and initiates a copy session. The problem is changing the initiator computer - the one that's running the script. From one computer the copying is ending successfully, but from a second one it times out. What I mean is that the copying on the target computer is finishing fine, but Expect on one of the Linux computers times out, and reports failure. One of the files being copied is a very large one (700MB), and when removing it from the source directory, the copy goes fine on both of the initiators. Also, when removing some of the subdirectories the copy is OK. =20 When running expect with debugging options, it seems that the output from the windows initiated computer, is kind of stuck. How can I debug the problem? (I've checked the dependent modules, IO::Pty, IO::Tty, POSIX, Fcntl, IO::Handle, and they appear to be the same on both of the computers) =20 Thanks!! =20 This is the script: #!/usr/bin/perl =20 use strict; use warnings; =20 use Expect; =20 my $command =3D Expect->spawn("nc dl380-02 4444") or die "Cannot = spwan\n"; $command->debug(3); $command->exp_internal(1); print "Spawned\n"; die "Did not find prompt" unless $command->expect(10, "WINNT"); print "found prompt\n"; $command->send("xcopy /Y /E /H /I E:\\tools F:\\tools\n\r"); $command->expect(180, "copied"); print "Error: ".$command->exp_error()."\n\n\n"; |
From: Austin S. <te...@of...> - 2004-07-13 06:57:36
|
On Mon, Jul 12, 2004 at 07:23:41PM -0700, Bala Ayres wrote: > Expect doesn't have a blocking mode or concept. Not quite true, case in point: $session->expect(); If you pass undef as the first argument to expect() it will block until it has matching patterns. In the example above it will block until EOF. This is useful e.g. where you wait for a process about to end but want to make sure it finishes spitting out its output first. > Except > gets chunks from the kernel buffer and it isn't always > keeping up with the interacting program. That is, > expect is usually behind and the application it is > interacting with is usually ahead. To sync up both, > (to block like you alluded to) , you need to loop on > the pattern you are looking for. You need to consume > all the patterns that are available on the stdout, > produced either by you "sending" them or produced by > the application. If you pass up any input, then your > expect program may appear to work, but not > consistently. > > > Take ls \n for example. You need to loop looking for > the command to return to unix prompt such $ or # or > > or what have you. > > While waiting - you should consume everything that > comes your way by using expect(3,'-re', "(.*?)\n") > (note .*? won't consume \n thus you have hard code \n. > You can do a nonblocking grab of existing output by doing expect(0, '.*'). The advantage being that if there is no data available it won't wait the 3 seconds as in the example above. > Every time you consume you should put that out to a > buffer such as $buffer .= $obj->match() ; > Sometimes you may have to use expect_before() but you > have to play with it to see what suits your response > best. > > I will be happy to post some samples if you need more > help. Good luck expecting. > There are also a few examples included with the tutorial. They are generally out of date, but maybe a good place to start as well. If you have code that would be of general use please copy it here, perhaps it would be useful to add to the module. Austin |
From: Bala A. <ba...@sb...> - 2004-07-13 02:23:47
|
Expect doesn't have a blocking mode or concept. Except gets chunks from the kernel buffer and it isn't always keeping up with the interacting program. That is, expect is usually behind and the application it is interacting with is usually ahead. To sync up both, (to block like you alluded to) , you need to loop on the pattern you are looking for. You need to consume all the patterns that are available on the stdout, produced either by you "sending" them or produced by the application. If you pass up any input, then your expect program may appear to work, but not consistently. Take ls \n for example. You need to loop looking for the command to return to unix prompt such $ or # or > or what have you. While waiting - you should consume everything that comes your way by using expect(3,'-re', "(.*?)\n") (note .*? won't consume \n thus you have hard code \n. Every time you consume you should put that out to a buffer such as $buffer .= $obj->match() ; Sometimes you may have to use expect_before() but you have to play with it to see what suits your response best. I will be happy to post some samples if you need more help. Good luck expecting. B Ayres --- ex...@th... wrote: > I'm trying to write a script in perl, using the > expect.pm module, which will > connect via ssh to a remote system and run a series > of commands. I can connect > and run commands, but am having trouble with the > interactive aspects of the script. > > I need to check the status of the system and make > calls accordingly, but cannot > find a way to make "blocking" calls (expect, wait, > send) or catch the return > value (e.g. send ("ls\n") and catch the results). > > Could you folks provide me with sample code or links > to documentation that could > help with this? I've read through the man, er > perldoc, page and could not find > solutions there. > > thanks, > Andrew > ex...@th... > > > ------------------------------------------------------- > This SF.Net email sponsored by Black Hat Briefings & > Training. > Attend Black Hat Briefings & Training, Las Vegas > July 24-29 - > digital self defense, top technical experts, no > vendor pitches, > unmatched networking opportunities. Visit > www.blackhat.com > _______________________________________________ > Expectperl-discuss mailing list > Exp...@li... > https://lists.sourceforge.net/lists/listinfo/expectperl-discuss > |
From: <ex...@th...> - 2004-07-12 16:46:09
|
I'm trying to write a script in perl, using the expect.pm module, which will connect via ssh to a remote system and run a series of commands. I can connect and run commands, but am having trouble with the interactive aspects of the script. I need to check the status of the system and make calls accordingly, but cannot find a way to make "blocking" calls (expect, wait, send) or catch the return value (e.g. send ("ls\n") and catch the results). Could you folks provide me with sample code or links to documentation that could help with this? I've read through the man, er perldoc, page and could not find solutions there. thanks, Andrew ex...@th... |
From: Roland G. <RGi...@cp...> - 2004-06-14 11:15:02
|
> Here=92s my problem. I spawn a ssh session to a remote box, and run a=20 > command. If the command is successful, I just get a new prompt, but i= f > it fails, the program spits out an error on STDERR. Currently,=20 > $exp_object->exp_before(),$exp_object->match(), and my=20 > $exp_object->exp_after() objects contain all the STDOUT info, but no=20 > STDERR info. How does one trap the STDERR strings? What fails? The ssh shell connection? Or the remote call? Expect=20 definitely gets everything that ssh returns on both STDOUT and STDERR.=20 It may miss things to /dev/tty on some systems in certain circumstances. > On a side note, is there a simple way to get the bash return code from = a=20 > command sent to a spawned ssh shell? Right now I=92m doing a =93echo $= ?=94=20 > and expecting =93\d\r=94 and parsing the string in $exp_object->match()= ; If the ssh is interactive, no. Keep using "echo $?". A one-shot ssh=20 command will correctly exit with the exit status of the remote command=20 (but you wouldn't use Expect then, would you?) Have you considered solving your problem by other means? Is the remote=20 app really interactive or could it also be run in a batchfile? How about=20 moving the Expect script to the remote host and running it there? Roland |
From: Tracie F. <tra...@tr...> - 2004-06-11 12:50:28
|
Why not do 2>&1? Redirect stderr to stdout? -----Original Message----- From: exp...@li... [mailto:exp...@li...] On Behalf Of Ryan Allen Sent: Thursday, June 10, 2004 9:08 PM To: exp...@li... Subject: [Expectperl-discuss] trapping remote shell stderr Hello perl expect list, Please forgive is this is totally obvious, but I've been searching books and on-line searches way too long! Here's my problem. I spawn a ssh session to a remote box, and run a command. If the command is successful, I just get a new prompt, but if it fails, the program spits out an error on STDERR. Currently, $exp_object->exp_before(),$exp_object->match(), and my $exp_object->exp_after() objects contain all the STDOUT info, but no STDERR info. How does one trap the STDERR strings? On a side note, is there a simple way to get the bash return code from a command sent to a spawned ssh shell? Right now I'm doing a "echo $?" and expecting "\d\r" and parsing the string in $exp_object->match(); Thanks!! - Ryan |
From: Ryan A. <r....@f5...> - 2004-06-11 01:07:56
|
Hello perl expect list, =20 Please forgive is this is totally obvious, but I've been searching books and on-line searches way too long! =20 Here's my problem. I spawn a ssh session to a remote box, and run a command. If the command is successful, I just get a new prompt, but if it fails, the program spits out an error on STDERR. Currently, $exp_object->exp_before(),$exp_object->match(), and my $exp_object->exp_after() objects contain all the STDOUT info, but no STDERR info. How does one trap the STDERR strings? =20 On a side note, is there a simple way to get the bash return code from a command sent to a spawned ssh shell? Right now I'm doing a "echo $?" and expecting "\d\r" and parsing the string in $exp_object->match(); =20 Thanks!! =20 - Ryan =20 =20 =20 =20 =20 |
From: Blackstone, J. D. <jda...@ci...> - 2004-06-01 18:26:53
|
> -----Original Message----- > From: exp...@li... > [mailto:exp...@li...] On > Behalf Of Peter Eisch > Sent: Tuesday, June 01, 2004 12:53 PM > To: exp...@li... > Subject: Re: [Expectperl-discuss] My tty drama > > > > It appears that last last week I became a bit overzealous in > my desire to be done with the project, so I'm back to it again. > > OS: RH7.3 > Process gets started from an init.d script which uses the > daemon() found in the init.d/functions to run as non-priv'd > user. The first thing my parent does is typical W Richard Stevens: > close(STDIN); > close(STDOUT); > close(STDERR); > POSIX::setsid(); > chdir("/"); > ... As an aside, there's a module out there to do all that for you, if you like. I believe it's called Proc::Daemon. jdb |
From: Peter E. <pe...@bo...> - 2004-06-01 17:52:44
|
It appears that last last week I became a bit overzealous in my desire to be done with the project, so I'm back to it again. OS: RH7.3 Process gets started from an init.d script which uses the daemon() found in the init.d/functions to run as non-priv'd user. The first thing my parent does is typical W Richard Stevens: close(STDIN); close(STDOUT); close(STDERR); POSIX::setsid(); chdir("/"); ... Then eventually it comes around to me where I: use Expect; ... $self->{_exp} = new Expect; $self->{_exp}->raw_pty(1); ... my @cmd = '/usr/bin/ftps'; push @cmd, '-e'; push @cmd, '-P', $self->{_port}; push @cmd, '-d' if ($self->{_debug}); push @cmd, '-p' if ($self->{_passive}); push @cmd, '-n' if ($self->{_autologin}); push @cmd, $self->{'_host'}; my $c = join ' ', @cmd; #becomes: /usr/bin/ftps -e -P 21 <host> $exp->log_file("/tmp/exp-$$", 'w') if ($DEBUG); $exp->spawn(@cmd) || return 0; $exp->expect($self->{_timeout}, [ qr/Name /i => sub { my $self = shift; $self->send($user . "\n"); exp_continue; }], [ qr/Password:/i => sub { my $self = shift; $self->send($pass . "\n"); exp_continue; }], $self->{_prompt}); And it's here that I time out never getting authenticated. In fact exactly nothing is written to the /tmp/exp-$$ file. If I run the same script, called the same, from a tty as the user that daemon() sets to, it works swell. I'm open to any thoughts, ideas, criticisms, etc. peter > From: Austin Schutz <te...@of...> > Date: Fri, 28 May 2004 10:35:56 -0700 > To: Peter Eisch <pe...@bo...> > Cc: exp...@li... > Subject: Re: [Expectperl-discuss] My tty drama > > On Fri, May 28, 2004 at 11:35:24AM -0500, Peter Eisch wrote: >> >> Yes, the difference is whether it runs as root or not. In fact, if I pull >> out all the tty calls except for raw_tty(1) and don't run as root it all >> chugs along just fine. >> >> My calls to expect() were messy to, my lesson for 'self' this morning is >> don't expect '' before sending the command, just stinking send the command. >> >> It just started working here in the last 20 mins and I have some stuff to do >> before I can get back to cleaning this up, but I'll fire off a redux when I >> can. >> > > Btw, what type of system are you trying to run this on? > > Austin > > > ------------------------------------------------------- > This SF.Net email is sponsored by: Oracle 10g > Get certified on the hottest thing ever to hit the market... Oracle 10g. > Take an Oracle 10g class now, and we'll give you the exam FREE. > http://ads.osdn.com/?ad_id=3149&alloc_id=8166&op=click > _______________________________________________ > Expectperl-discuss mailing list > Exp...@li... > https://lists.sourceforge.net/lists/listinfo/expectperl-discuss > |
From: Austin S. <te...@of...> - 2004-05-28 17:36:05
|
On Fri, May 28, 2004 at 11:35:24AM -0500, Peter Eisch wrote: > > Yes, the difference is whether it runs as root or not. In fact, if I pull > out all the tty calls except for raw_tty(1) and don't run as root it all > chugs along just fine. > > My calls to expect() were messy to, my lesson for 'self' this morning is > don't expect '' before sending the command, just stinking send the command. > > It just started working here in the last 20 mins and I have some stuff to do > before I can get back to cleaning this up, but I'll fire off a redux when I > can. > Btw, what type of system are you trying to run this on? Austin |
From: Peter E. <pe...@bo...> - 2004-05-28 16:35:37
|
Yes, the difference is whether it runs as root or not. In fact, if I pull out all the tty calls except for raw_tty(1) and don't run as root it all chugs along just fine. My calls to expect() were messy to, my lesson for 'self' this morning is don't expect '' before sending the command, just stinking send the command. It just started working here in the last 20 mins and I have some stuff to do before I can get back to cleaning this up, but I'll fire off a redux when I can. Thanks all, peter > From: Roland Giersig <RGi...@cp...> > Date: Fri, 28 May 2004 10:45:02 +0200 > To: exp...@li... > Subject: Re: [Expectperl-discuss] My tty drama > >> Note that if I ran it from the command-line (real tty) it ran fine. > > Yes, thats one thing that is still baffling me. You see, I modelled the > pty allocation code mostly after sshd, so it should work to capture even > /dev/tty of the spawned process, but it sometimes (on some systems, as a > daemon, without a user tty) doesn't. Unfortunately, sshd runs as root, > so it can do some things that normal processes cannot do, and I left out > those things (if I remember correctly, it has been a while). And pty > allocation *is* black magic, very heavy black magic indeed. > > So, the short answer is: sorry, I don't know why it doesn't work. And > that's the reason why I always ask people if there is a way to solve the > problem without using Expect, using ssh/scp/ncftp/Net::Telnet etc. > instead... > > Roland > > > ------------------------------------------------------- > This SF.Net email is sponsored by: Oracle 10g > Get certified on the hottest thing ever to hit the market... Oracle 10g. > Take an Oracle 10g class now, and we'll give you the exam FREE. > http://ads.osdn.com/?ad_id=3149&alloc_id=8166&op=click > _______________________________________________ > Expectperl-discuss mailing list > Exp...@li... > https://lists.sourceforge.net/lists/listinfo/expectperl-discuss > |
From: Roland G. <RGi...@cp...> - 2004-05-28 16:07:38
|
> Note that if I ran it from the command-line (real tty) it ran fine. Yes, thats one thing that is still baffling me. You see, I modelled the pty allocation code mostly after sshd, so it should work to capture even /dev/tty of the spawned process, but it sometimes (on some systems, as a daemon, without a user tty) doesn't. Unfortunately, sshd runs as root, so it can do some things that normal processes cannot do, and I left out those things (if I remember correctly, it has been a while). And pty allocation *is* black magic, very heavy black magic indeed. So, the short answer is: sorry, I don't know why it doesn't work. And that's the reason why I always ask people if there is a way to solve the problem without using Expect, using ssh/scp/ncftp/Net::Telnet etc. instead... Roland |
From: Peter E. <pe...@bo...> - 2004-05-27 18:54:37
|
>> [ Hey, for those that only know sermons and not gospel, point me to the >> FTPS.pm and I'll gladly use that then suffer through this drama. ] > > Maybe you can make one using Expect so the rest of us can avoid > the suffering. > Certainly. ... >> use Carp; >> use Expect; > > Toss a little debugging in. > $Expect::Debug=1; > $Expect::Exp_Internal=1; > Cool... > You're creating a bit of extra work here by not creating a lexical to > hold $self->{_exp}. It looks like this fouls you up below. > Try this: > >> $self->{_exp} = new Expect; > $expect = $self->{_exp}; > Seems reasonable to me. ... >> >> $self->{_exp}->expect($self->{_timeout}, >> [ qr/Name /i, sub { my $self = shift; >> $self->send($user . "\n"); > ^^^^^^^^^^^ > > Does '$self' have a send method? $self->{_exp}->send()? or, better > yet, $expect->send(). The 'my $self = shift; $self->send()' all happens within the instance of Expect. The little trick of using $self within a sequence seems pretty nifty, but I've changed it to $exp... the result is the same. > >> exp_continue; }], >> [ qr/Password:/i, sub { my $self = shift; >> $self->send($pass . "\n"); > ^^^^^^^^^^^ >> exp_continue; }], >> $self->{_prompt}); > > > Try fixing that, and turn on debugging. > Note that if I ran it from the command-line (real tty) it ran fine. For example, when I run it as a daemon the log file found in /tmp/exp-$$ only logs this: [root@fubar root]# cat /tmp/exp-25225 Connected to secureftp.some.gvmt.office. 220- Department of Human Service Secure Transport site! 220- 220 Secure FTP Server ready. If I run it from the command line: [root@fubar root]# cat /tmp/exp-18484 Connected to secureftp.some.gvmt.office. 220- Department of Human Service Secure Transport site! 220- 220 Secure FTP Server ready. Name (secureftp.some.gvmt.office:root): 234 SSLv23/TLSv1 [TLSv1/SSLv3, cipher DES-CBC3-SHA, 168 bits] 331 Password required for username. Password: 230 Virtual user username logged in. 235 PBSZ=0 200 PROT command successful TLS/SSL protection of data connections on. Remote system type is UNIX. Using binary mode to transfer files. ftps> 250 CWD command successful. ftps> 200 PORT command successful. 150 Opening ASCII mode SSL data connection for file list. total 353677 -rwxrwxrwx 1 root 2000 61009251 May 20 08:54 965713400_RiskAdj_20040519.dat -rwxrwxrwx 1 root 2000 59063559 Feb 20 15:42 965713400_RiskAdj_risk.dat -rwxrwxrwx 1 root 2000 61009251 May 18 17:24 965713400_RiskAdj_risk_051904.dat 226 Transfer complete. ftps> local: /home/rs/tp/username/to-username/.965713400_RiskAdj_20040519.dat remote: 965713400_RiskAdj_20040519.dat 200 PORT command successful. 150 Opening BINARY mode SSL data connection for 965713400_RiskAdj_20040519.dat. 1% 648 KB 06:03 ETA Yeah, I can turn off the verbose stuff at some point... Other thoughts? Thanks, peter |
From: Austin S. <te...@of...> - 2004-05-27 16:36:49
|
On Thu, May 27, 2004 at 11:11:21AM -0500, Peter Eisch wrote: > > I'm having the age-old problem tty issues where when I run the script from > the command-line things work like they should. If it runs from the daemon > it doesn't work right though the script itself seems to run. The client is > bsdftps, er ftps from the command-line. > > [ Hey, for those that only know sermons and not gospel, point me to the > FTPS.pm and I'll gladly use that then suffer through this drama. ] Maybe you can make one using Expect so the rest of us can avoid the suffering. > > My relevant portions: > > use POSIX ":sys_wait_h"; > use FileHandle; > use IO::File; > use IO::Select; > use IO::Pty; > use Carp; > use Expect; Toss a little debugging in. $Expect::Debug=1; $Expect::Exp_Internal=1; > > $Expect::Log_Stdout=0; You're creating a bit of extra work here by not creating a lexical to hold $self->{_exp}. It looks like this fouls you up below. Try this: > $self->{_exp} = new Expect; $expect = $self->{_exp}; > $self->{_exp}->raw_pty(1); > $self->{_exp}->stty('raw'); > $self->{_prompt} = 'ftps>'; > $self->{_timeout} = 10; > my @cmd = '/usr/bin/ftps'; > push @cmd, '-e'; > push @cmd, '-v'; > push @cmd, '-P', $self->{_port}; > push @cmd, '-d' if ($self->{_debug}); > push @cmd, '-p' if ($self->{_passive}); > push @cmd, '-n' if ($self->{_autologin}); > push @cmd, $self->{'_host'}; > my $c = join ' ', @cmd; > VSI::RS::Results->new($ident, 0, '', '', 0)->logThis('debug', "STARTUP: > $c") if ($DEBUG); > > close(STDOUT); > open(STDOUT, '>/dev/null'); > close(STDIN); > close(STDERR); > $self->{_exp}->log_file("/tmp/exp-$$", 'w'); > > #$self->{_exp}->slave->set_raw(); > #$self->{_exp}->set_raw(); > > $self->{_exp}->spawn(@cmd) || > return 0; > > $self->{_exp}->expect($self->{_timeout}, > [ qr/Name /i, sub { my $self = shift; > $self->send($user . "\n"); ^^^^^^^^^^^ Does '$self' have a send method? $self->{_exp}->send()? or, better yet, $expect->send(). > exp_continue; }], > [ qr/Password:/i, sub { my $self = shift; > $self->send($pass . "\n"); ^^^^^^^^^^^ > exp_continue; }], > $self->{_prompt}); Try fixing that, and turn on debugging. Good luck, Austin |
From: Peter E. <pe...@bo...> - 2004-05-27 16:11:30
|
I'm having the age-old problem tty issues where when I run the script from the command-line things work like they should. If it runs from the daemon it doesn't work right though the script itself seems to run. The client is bsdftps, er ftps from the command-line. [ Hey, for those that only know sermons and not gospel, point me to the FTPS.pm and I'll gladly use that then suffer through this drama. ] My relevant portions: use POSIX ":sys_wait_h"; use FileHandle; use IO::File; use IO::Select; use IO::Pty; use Carp; use Expect; $Expect::Log_Stdout=0; $self->{_exp} = new Expect; $self->{_exp}->raw_pty(1); $self->{_exp}->stty('raw'); $self->{_prompt} = 'ftps>'; $self->{_timeout} = 10; my @cmd = '/usr/bin/ftps'; push @cmd, '-e'; push @cmd, '-v'; push @cmd, '-P', $self->{_port}; push @cmd, '-d' if ($self->{_debug}); push @cmd, '-p' if ($self->{_passive}); push @cmd, '-n' if ($self->{_autologin}); push @cmd, $self->{'_host'}; my $c = join ' ', @cmd; VSI::RS::Results->new($ident, 0, '', '', 0)->logThis('debug', "STARTUP: $c") if ($DEBUG); close(STDOUT); open(STDOUT, '>/dev/null'); close(STDIN); close(STDERR); $self->{_exp}->log_file("/tmp/exp-$$", 'w'); #$self->{_exp}->slave->set_raw(); #$self->{_exp}->set_raw(); $self->{_exp}->spawn(@cmd) || return 0; $self->{_exp}->expect($self->{_timeout}, [ qr/Name /i, sub { my $self = shift; $self->send($user . "\n"); exp_continue; }], [ qr/Password:/i, sub { my $self = shift; $self->send($pass . "\n"); exp_continue; }], $self->{_prompt}); my $return = $self->{_exp}->before(); foreach my $line (split /\r?\n/, $return) { $self->message($line) if ($line =~ /^(\d+) /); } All of the above works to where it can connect and log in. So then I set to the directory with: my $cmd = "cd $dir\n"; $self->{_exp}->expect($self->{_timeout}, '', $self->{_exp}->send($cmd), $self->{_prompt}); my $return = $self->{_exp}->before(); foreach my $line (split /\r?\n/, $return) { $self->message($line) if ($line =~ /^(\d+) /); } But I never get back the junk I should after the command is issued. Oddly, my prompt matches. Assuming though that the 'cd' worked, I'm getting nothing back when I do a listing in the directory: my $cmd = "dir\n"; my @list; my @listing; $self->{_exp}->expect($self->{_timeout}, '', $self->{_exp}->send($cmd), $self->{_prompt}); my $return = $self->{_exp}->before(); foreach my $line (split /\r?\n/, $return) { my @fields = split /\s+/, $line; if ((scalar @fields) >= 9 && $line!~/^\d{3}/) { my $index = (scalar @list); $list[$index]{'perm'} = shift @fields; # perms shift @fields; # skip weird thing $list[$index]{'user'} = shift @fields; $list[$index]{'group'} = shift @fields; $list[$index]{'size'} = shift @fields; $list[$index]{'date'} = join ' ', (shift @fields, shift @fields, shift @fields); $list[$index]{'filename'} = join ' ', @fields; # push @listing, $list[$index]{'filename'}; $listing[$index] = $list[$index]{'filename'}; } else { $self->message($line) if ($line =~ /(\d+) /); } } return @listing; Again, if I run the same process without being invoked underneath (RH7.3): daemon --user genuser ... It all works swell. What [simple] detail am I missing? Many thanks, peter |