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: Adrian P. <ad...@po...> - 2003-07-20 10:13:23
|
I've written a module that uses Expect to control a remote shell session using either rsh or ssh (rcp not really tested). It also allows files to be copied back and forth through the session. One problem I had a hard time figuring out was a copy of a binary file from the remote end of the connection to the local end which kept coming short. Eventually, after much debugging of my own code, I found a small but nasty hack in Expect :- # ugly hack for broken solaris ttys that spew <blank><backspace> # into our pretty output $buffer =~ s/ \cH//g; Argh !! :-) Anyway, I think the hack is okay but should not really be enabled by default. Thus the following patch. Of course the way I'm using Expect may be the biggest problem :-) Comments. Sincerely, Adrian Phillips -- Who really wrote the works of William Shakespeare ? http://www.pbs.org/wgbh/pages/frontline/shakespeare/ --- libexpect-perl-1.15/Expect.pm 2003-07-04 14:07:46.000000000 +0200 +++ libexpect-perl-1.15.1/Expect.pm 2003-07-04 14:13:51.000000000 +0200 @@ -53,6 +53,7 @@ @Expect::Before_List = (); @Expect::After_List = (); %Expect::Spawned_PIDs = (); + $Expect::Broken_space_backspace = 0; } sub version { @@ -859,7 +860,7 @@ # ugly hack for broken solaris ttys that spew <blank><backspace> # into our pretty output - $buffer =~ s/ \cH//g; + $buffer =~ s/ \cH//g if $Expect::Broken_space_backspace; # Append it to the accumulator. ${*$exp}{exp_Accum} .= $buffer; if (exists ${*$exp}{exp_Max_Accum} |
From: Adrian P. <ad...@po...> - 2003-07-19 10:20:41
|
>>>>> "Roland" == Roland Giersig <RGi...@cp...> writes: Roland> well, this is a linux kernel problem, somebody decided Roland> that ptys need not handle lines longer than 155 bytes at a Roland> time, so there. I'm just the messenger, talk to redhat Which Linux kernel ? In 2.4.20 :- ./include/linux/tty.h:153:#define PTY_BUF_SIZE 4*TTY_FLIPBUF_SIZE ./include/linux/tty.h:137:#define TTY_FLIPBUF_SIZE 512 Which means 2048 not 155. Is the limit some other place, libc or is yet another Redhat x.0 screw up ? On my machine, 2.4.20 glibc 3.2.1 it is definitely 2048 as I have a perl module based upon Expect where each read and write of a big transfer through the pty receives/sends 2048. Sincerely, Adrian Phillips -- Who really wrote the works of William Shakespeare ? http://www.pbs.org/wgbh/pages/frontline/shakespeare/ |
From: Alan J. <al...@ra...> - 2003-07-18 18:39:00
|
Thanks for the prompt reply. As you have suggested, I have included the script below. Maybe that can give you a clue as to what is going wrong. Thanks for the help. ----------------------------------------------------------------------------- #!/usr/bin/perl use Expect; #change the source and destination path here! $ssh=Expect->spawn("rsync -avzu --delete --progress --stats --rsync-path /path-to-rsync -e ssh /source-path account\@xxx.edu:/destination-path"); # No changes needed from here on $ssh->expect(10,"ssword: ") || die "Never got password prompt on rci.rutgers.edu, ".$ssh->exp_error()."\n"; # We got the prompt, so send a password. print $ssh "xxxxxxx"; $match=$ssh->expect(10,"closed by foreign host","-re",'[%>$]\s'); die "Files have been updated on xxx.edu\n" unless $match; $ssh->hard_close(); -------------------------------------------------------------------------- On Tue, 15 Jul 2003 db...@ct... wrote: > > I tried reproducing the slowness problem you mentioned since one of my > boxes is Redhat 9 but was unable. > > I tried the following: > > 1.) scripting lengthy "ls -la" in a telnet session to remote machine. > 2.) scripting rsync <username>@<hostname>:<remotefile> <localfile> for > JPG file about 160K in size. > > When installing modules, I got the same "default pty only handles 155 > bytes" message, also another message saying that raw pty was ok, and > handled 512+ bytes. This was when running "make test" on the Expect > module. Setting both $exp->raw_pty(1) and $exp->raw_pty(0) on different > trial runs before spawning either process didn't seem to make a difference. > Both processes took just a second or so each. > > I'm trying to think of what could be causing your problem. If you're using > Expect to spawn rsync, it's the rsync process that's moving the data; not > expect. expect is just it's parent and thus getting STDOUT from the rsync > process, so I'm thinking the amount of data rsync is moving between the > websites in itself should be irrelevant. Are you running the most current > versions of everything? If you can post some of the relevant code I'll > take a look when I get a minute > > > > > > > > Alan Jiang <al...@ra...> > Sent by: To: expect <ex...@ih...> > exp...@li...urc cc: exp...@li... > eforge.net Subject: Re: [Expectperl-discuss] help!! > > > 07/14/03 08:03 PM > > > > > > > I am quite sure it is a expect problem because if I run the rsync process > independent of expect (i.e. manually entering the password at the prompt > insteading of having expect module to automate the procedure), everything > runs just fine. One more piece of evidence is that I didn't get this > warning message about default pty can only handle 155 bytes when I > installed it on redhat 7.2, and the module works perfect on that system. I > wonder if rehhat 9.0 is doing something funny that messes up the expect > module. > > Alan > > > On Mon, 14 > Jul 2003, expect wrote: > > > On Mon, 14 Jul 2003 13:14:42 -0400 (EDT) > > Alan Jiang <al...@ra...> wrote: > > > > > Hi, > > > I have an emergency problem that I need your help. I have just > installed > > > expect-1.15 on redhat 9.0 and receive the following warning message: > > > > > > Warning: your default pty can only handle 155 bytes at a time! > > > ok 30 > > > > > > This warning message didn't come up during the installation on > !!!redhat > > > 7.1!!!! > > > I use your expect module to work with rsync to synchronize two website. > > > > It now takes forever to update (serveral runs for just one small file). > > > > Can you please tell me how this problem can be solved? Thanks. > > > > > > Alan > > > > You probably need to convince me that it's an Expect problem. > > You haven't so far. > > > > Maybe you can wrap some timings around things using > > use Benchmark; > > > > to make your case. > > |
From: <db...@CT...> - 2003-07-15 21:27:17
|
I tried reproducing the slowness problem you mentioned since one of my boxes is Redhat 9 but was unable. I tried the following: 1.) scripting lengthy "ls -la" in a telnet session to remote machine. 2.) scripting rsync <username>@<hostname>:<remotefile> <localfile> for JPG file about 160K in size. When installing modules, I got the same "default pty only handles 155 bytes" message, also another message saying that raw pty was ok, and handled 512+ bytes. This was when running "make test" on the Expect module. Setting both $exp->raw_pty(1) and $exp->raw_pty(0) on different trial runs before spawning either process didn't seem to make a difference. Both processes took just a second or so each. I'm trying to think of what could be causing your problem. If you're using Expect to spawn rsync, it's the rsync process that's moving the data; not expect. expect is just it's parent and thus getting STDOUT from the rsync process, so I'm thinking the amount of data rsync is moving between the websites in itself should be irrelevant. Are you running the most current versions of everything? If you can post some of the relevant code I'll take a look when I get a minute Alan Jiang <al...@ra...> Sent by: To: expect <ex...@ih...> exp...@li...urc cc: exp...@li... eforge.net Subject: Re: [Expectperl-discuss] help!! 07/14/03 08:03 PM I am quite sure it is a expect problem because if I run the rsync process independent of expect (i.e. manually entering the password at the prompt insteading of having expect module to automate the procedure), everything runs just fine. One more piece of evidence is that I didn't get this warning message about default pty can only handle 155 bytes when I installed it on redhat 7.2, and the module works perfect on that system. I wonder if rehhat 9.0 is doing something funny that messes up the expect module. Alan On Mon, 14 Jul 2003, expect wrote: > On Mon, 14 Jul 2003 13:14:42 -0400 (EDT) > Alan Jiang <al...@ra...> wrote: > > > Hi, > > I have an emergency problem that I need your help. I have just installed > > expect-1.15 on redhat 9.0 and receive the following warning message: > > > > Warning: your default pty can only handle 155 bytes at a time! > > ok 30 > > > > This warning message didn't come up during the installation on !!!redhat > > 7.1!!!! > > I use your expect module to work with rsync to synchronize two website. > > It now takes forever to update (serveral runs for just one small file). > > Can you please tell me how this problem can be solved? Thanks. > > > > Alan > > You probably need to convince me that it's an Expect problem. > You haven't so far. > > Maybe you can wrap some timings around things using > use Benchmark; > > to make your case. > > > > > > > > > > > ------------------------------------------------------- > > This SF.Net email sponsored by: Parasoft > > Error proof Web apps, automate testing & more. > > Download & eval WebKing and get a free book. > > www.parasoft.com/bulletproofapps1 > > _______________________________________________ > > Expectperl-discuss mailing list > > Exp...@li... > > https://lists.sourceforge.net/lists/listinfo/expectperl-discuss > > > > > > > > > ------------------------------------------------------- > This SF.Net email sponsored by: Parasoft > Error proof Web apps, automate testing & more. > Download & eval WebKing and get a free book. > www.parasoft.com/bulletproofapps1 > _______________________________________________ > Expectperl-discuss mailing list > Exp...@li... > https://lists.sourceforge.net/lists/listinfo/expectperl-discuss > ------------------------------------------------------- This SF.Net email sponsored by: Parasoft Error proof Web apps, automate testing & more. Download & eval WebKing and get a free book. www.parasoft.com/bulletproofapps1 _______________________________________________ Expectperl-discuss mailing list Exp...@li... https://lists.sourceforge.net/lists/listinfo/expectperl-discuss |
From: expect <ex...@ih...> - 2003-07-15 00:22:34
|
On Mon, 14 Jul 2003 20:03:02 -0400 (EDT) Alan Jiang <al...@ra...> wrote: > I am quite sure it is a expect problem because if I run the rsync process > independent of expect (i.e. manually entering the password at the prompt > insteading of having expect module to automate the procedure), everything > runs just fine. One more piece of evidence is that I didn't get this > warning message about default pty can only handle 155 bytes when I > installed it on redhat 7.2, and the module works perfect on that system. I > wonder if rehhat 9.0 is doing something funny that messes up the expect > module. > > Alan See Roland's response. > > > On Mon, 14 > Jul 2003, expect wrote: > > > On Mon, 14 Jul 2003 13:14:42 -0400 (EDT) > > Alan Jiang <al...@ra...> wrote: > > > > > Hi, > > > I have an emergency problem that I need your help. I have just installed > > > expect-1.15 on redhat 9.0 and receive the following warning message: > > > > > > Warning: your default pty can only handle 155 bytes at a time! > > > ok 30 > > > > > > This warning message didn't come up during the installation on !!!redhat > > > 7.1!!!! > > > I use your expect module to work with rsync to synchronize two website. > > > It now takes forever to update (serveral runs for just one small file). > > > Can you please tell me how this problem can be solved? Thanks. > > > > > > Alan > > > > You probably need to convince me that it's an Expect problem. > > You haven't so far. > > > > Maybe you can wrap some timings around things using > > use Benchmark; > > > > to make your case. > > > > > > > > > > > > > > > > > ------------------------------------------------------- > > > This SF.Net email sponsored by: Parasoft > > > Error proof Web apps, automate testing & more. > > > Download & eval WebKing and get a free book. > > > www.parasoft.com/bulletproofapps1 > > > _______________________________________________ > > > Expectperl-discuss mailing list > > > Exp...@li... > > > https://lists.sourceforge.net/lists/listinfo/expectperl-discuss > > > > > > > > > > > > > > > > ------------------------------------------------------- > > This SF.Net email sponsored by: Parasoft > > Error proof Web apps, automate testing & more. > > Download & eval WebKing and get a free book. > > www.parasoft.com/bulletproofapps1 > > _______________________________________________ > > Expectperl-discuss mailing list > > Exp...@li... > > https://lists.sourceforge.net/lists/listinfo/expectperl-discuss > > > > > > ------------------------------------------------------- > This SF.Net email sponsored by: Parasoft > Error proof Web apps, automate testing & more. > Download & eval WebKing and get a free book. > www.parasoft.com/bulletproofapps1 > _______________________________________________ > Expectperl-discuss mailing list > Exp...@li... > https://lists.sourceforge.net/lists/listinfo/expectperl-discuss > > |
From: Alan J. <al...@ra...> - 2003-07-15 00:03:07
|
I am quite sure it is a expect problem because if I run the rsync process independent of expect (i.e. manually entering the password at the prompt insteading of having expect module to automate the procedure), everything runs just fine. One more piece of evidence is that I didn't get this warning message about default pty can only handle 155 bytes when I installed it on redhat 7.2, and the module works perfect on that system. I wonder if rehhat 9.0 is doing something funny that messes up the expect module. Alan On Mon, 14 Jul 2003, expect wrote: > On Mon, 14 Jul 2003 13:14:42 -0400 (EDT) > Alan Jiang <al...@ra...> wrote: > > > Hi, > > I have an emergency problem that I need your help. I have just installed > > expect-1.15 on redhat 9.0 and receive the following warning message: > > > > Warning: your default pty can only handle 155 bytes at a time! > > ok 30 > > > > This warning message didn't come up during the installation on !!!redhat > > 7.1!!!! > > I use your expect module to work with rsync to synchronize two website. > > It now takes forever to update (serveral runs for just one small file). > > Can you please tell me how this problem can be solved? Thanks. > > > > Alan > > You probably need to convince me that it's an Expect problem. > You haven't so far. > > Maybe you can wrap some timings around things using > use Benchmark; > > to make your case. > > > > > > > > > > > ------------------------------------------------------- > > This SF.Net email sponsored by: Parasoft > > Error proof Web apps, automate testing & more. > > Download & eval WebKing and get a free book. > > www.parasoft.com/bulletproofapps1 > > _______________________________________________ > > Expectperl-discuss mailing list > > Exp...@li... > > https://lists.sourceforge.net/lists/listinfo/expectperl-discuss > > > > > > > > > ------------------------------------------------------- > This SF.Net email sponsored by: Parasoft > Error proof Web apps, automate testing & more. > Download & eval WebKing and get a free book. > www.parasoft.com/bulletproofapps1 > _______________________________________________ > Expectperl-discuss mailing list > Exp...@li... > https://lists.sourceforge.net/lists/listinfo/expectperl-discuss > |
From: Roland G. <RGi...@cp...> - 2003-07-14 22:13:25
|
Zitat von Alan Jiang <al...@ra...>: > Hi, > I have an emergency problem that I need your help. I have just > installed expect-1.15 on redhat 9.0 and receive the following warning > message: > > Warning: your default pty can only handle 155 bytes at a time! > ok 30 > > This warning message didn't come up during the installation on > !!!redhat 7.1!!!! > I use your expect module to work with rsync to synchronize two > website. > It now takes forever to update (serveral runs for just one small > file). > Can you please tell me how this problem can be solved? Thanks. well, this is a linux kernel problem, somebody decided that ptys need not handle lines longer than 155 bytes at a time, so there. I'm just the messenger, talk to redhat about that issue. normally it should work anyway, but theres no guarantee. but are you sure that it is this issue that is causing the problem? maybe its located somewhere else? have you tried the rsync procedure manually? tried to find where the time is lost in the expect script? -- RGi...@cp... |
From: expect <ex...@ih...> - 2003-07-14 21:16:05
|
On Mon, 14 Jul 2003 13:14:42 -0400 (EDT) Alan Jiang <al...@ra...> wrote: > Hi, > I have an emergency problem that I need your help. I have just installed > expect-1.15 on redhat 9.0 and receive the following warning message: > > Warning: your default pty can only handle 155 bytes at a time! > ok 30 > > This warning message didn't come up during the installation on !!!redhat > 7.1!!!! > I use your expect module to work with rsync to synchronize two website. > It now takes forever to update (serveral runs for just one small file). > Can you please tell me how this problem can be solved? Thanks. > > Alan You probably need to convince me that it's an Expect problem. You haven't so far. Maybe you can wrap some timings around things using use Benchmark; to make your case. > > > > > ------------------------------------------------------- > This SF.Net email sponsored by: Parasoft > Error proof Web apps, automate testing & more. > Download & eval WebKing and get a free book. > www.parasoft.com/bulletproofapps1 > _______________________________________________ > Expectperl-discuss mailing list > Exp...@li... > https://lists.sourceforge.net/lists/listinfo/expectperl-discuss > > |
From: Alan J. <al...@ra...> - 2003-07-14 17:14:45
|
Hi, I have an emergency problem that I need your help. I have just installed expect-1.15 on redhat 9.0 and receive the following warning message: Warning: your default pty can only handle 155 bytes at a time! ok 30 This warning message didn't come up during the installation on !!!redhat 7.1!!!! I use your expect module to work with rsync to synchronize two website. It now takes forever to update (serveral runs for just one small file). Can you please tell me how this problem can be solved? Thanks. Alan |
From: Allen H. <al...@hu...> - 2003-07-08 16:54:33
|
Hi, Does anyone on the list have any experience getting Expect to work on Mac OS X? I find that the tests fail very early in the make test, and was hoping that someone can point me in the right direction. Here are the errors I see when building Expect with CPAN: CPAN.pm: Going to build R/RG/RGIERSIG/Expect-1.15.tar.gz Checking if your kit is complete... Looks good Writing Makefile for Expect cp Expect.pm blib/lib/Expect.pm cp Expect.pod blib/lib/Expect.pod Manifying blib/man3/Expect.3 /usr/bin/make -- OK Running make test PERL_DL_NONLAZY=1 /usr/bin/perl "-Iblib/lib" "-Iblib/arch" test.pl 1..36 Basic tests... ok 1 Use of uninitialized value in numeric eq (==) at test.pl line 37. not ok 2 # Test failed at test.pl line 22. Died at test.pl line 22. make: *** [test_dynamic] Error 255 /usr/bin/make test -- NOT OK Thanks, Allen -- al...@hu... www.hutchison.org/allen |
From: Chris M. <mut...@mc...> - 2003-07-08 15:56:20
|
Hey, I was originally using Perl 5.5.3 (5.00503) (what came with RH6.2), and Expect-1.15, IO-Stty-.02, and IO-Tty-1.02. I noticed that my old version of perl has the problem, perl 5.6.0 has the problem, but perl 5.6.1 does not. I upgraded to perl 5.8.0 and I no longer see double output. Thanks the help, I appreciate it. -Chris Original message from: "Sorrell, Al" >I get the same results using older versions of the software: > >Solaris 6 >Perl v5.60 >IO-Tty-0.97 01 (beta) 03/04/2002 >Expect-1.13 08 (beta) 03/04/2002 > >(sorrell@netops)$ $HOME/temp/xx.pl ><you will see this string twice ><you will see this string twice ><you >will see this string once > > >-----Original Message----- >From: db...@CT... [mailto:db...@CT...] >Sent: Monday, July 07, 2003 11:14 AM >To: Chris Muth >Cc: Exp...@li...; >exp...@li... >Subject: Re: [Expectperl-discuss] Double prints to screen from one print >statement? > > > >For what it's worth, I only get one print of the string instead of two >on >both my setups, which are as follows: > > Setup #1: > OS=Redhat Linux 7.3 > IO::Tty= version 1.02 > Perl=5.6.1 > Expect.pm= 1.15 > > Setup #2: > OS=Solaris 7 (Sparc 4500) > IO::Tty= version 1.02 > Perl=5.8.0 > Expect.pm= 1.15 > > > > > > > > Chris Muth <mut...@mc...> > > Sent by: To: >Exp...@li... > exp...@li...urc cc: > > eforge.net Subject: >[Expectperl-discuss] Double prints to screen > from one >print statement? > > > 07/06/2003 09:47 PM > > > > > > > > > >Hey, > >I have been having trouble with print statements in my perl scripts >printing to the screen twice. They are just standard print statements >to STDOUT, not much to do with Expect. > >As seen in the fragment below the print before the call to spawn() >will get be seen in the output twice, and the one below will be seen >in the output once. > >Is this a bug, or is this just an idiosyncrasy that one must simply make >allowances for? > >Thanks, >Chris > > >#!/usr/bin/perl -w ># ># > >use Expect; > > >$exp = new Expect; >$exp->raw pty(1); > ># Above spawn() we see it twice. >print "<you will see this string twice >"; > >$exp->spawn("/bin/ls"); > ># Below spawn() we see it once. >print "<you will see this string once >"; > >print "\n"; > ># EOF > > > >------------------------------------------------------- >This SF.Net email sponsored by: Free pre-built ASP.NET sites including >Data Reports, E-commerce, Portals, and Forums are available now. >Download today and enter to win an XBOX or Visual Studio .NET. >http://aspnet.click-url.com/go/psa00100006ave/direct;at.asp 061203 01/01 > >Expectperl-discuss mailing list >Exp...@li... >https://lists.sourceforge.net/lists/listinfo/expectperl-discuss > > > > > > >------------------------------------------------------- >This SF.Net email sponsored by: Free pre-built ASP.NET sites including >Data Reports, E-commerce, Portals, and Forums are available now. >Download today and enter to win an XBOX or Visual Studio .NET. >http://aspnet.click-url.com/go/psa00100006ave/direct;at.asp 061203 01/01 > >Expectperl-discuss mailing list >Exp...@li... >https://lists.sourceforge.net/lists/listinfo/expectperl-discuss > > >------------------------------------------------------- >This SF.Net email sponsored by: Free pre-built ASP.NET sites including >Data Reports, E-commerce, Portals, and Forums are available now. >Download today and enter to win an XBOX or Visual Studio .NET. >http://aspnet.click-url.com/go/psa00100006ave/direct;at.asp 061203 01/01 > >Expectperl-discuss mailing list >Exp...@li... >https://lists.sourceforge.net/lists/listinfo/expectperl-discuss |
From: Sorrell, A. <Al_...@tr...> - 2003-07-07 15:44:36
|
I get the same results using older versions of the software: Solaris 6=20 Perl v5.60=20 IO-Tty-0.97_01 (beta) 03/04/2002 Expect-1.13_08 (beta) 03/04/2002 (sorrell@netops)$ $HOME/temp/xx.pl <you will see this string twice ><you will see this string twice ><you will see this string once > -----Original Message----- From: db...@CT... [mailto:db...@CT...]=20 Sent: Monday, July 07, 2003 11:14 AM To: Chris Muth Cc: Exp...@li...; exp...@li... Subject: Re: [Expectperl-discuss] Double prints to screen from one print statement? For what it's worth, I only get one print of the string instead of two on both my setups, which are as follows: Setup #1: OS=3DRedhat Linux 7.3 IO::Tty=3D version 1.02 Perl=3D5.6.1 Expect.pm=3D 1.15 Setup #2: OS=3DSolaris 7 (Sparc 4500) IO::Tty=3D version 1.02 Perl=3D5.8.0 Expect.pm=3D 1.15 =20 Chris Muth <mut...@mc...> Sent by: To: Exp...@li... =20 exp...@li...urc cc: eforge.net Subject: [Expectperl-discuss] Double prints to screen =20 from one print statement? =20 =20 07/06/2003 09:47 PM =20 =20 Hey, I have been having trouble with print statements in my perl scripts printing to the screen twice. They are just standard print statements to STDOUT, not much to do with Expect. As seen in the fragment below the print before the call to spawn() will get be seen in the output twice, and the one below will be seen in the output once. Is this a bug, or is this just an idiosyncrasy that one must simply make allowances for? Thanks, Chris #!/usr/bin/perl -w # # use Expect; $exp =3D new Expect; $exp->raw_pty(1); # Above spawn() we see it twice. print "<you will see this string twice >"; $exp->spawn("/bin/ls"); # Below spawn() we see it once. print "<you will see this string once >"; print "\n"; # EOF ------------------------------------------------------- This SF.Net email sponsored by: Free pre-built ASP.NET sites including Data Reports, E-commerce, Portals, and Forums are available now. Download today and enter to win an XBOX or Visual Studio .NET. http://aspnet.click-url.com/go/psa00100006ave/direct;at.asp_061203_01/01 _______________________________________________ Expectperl-discuss mailing list Exp...@li... https://lists.sourceforge.net/lists/listinfo/expectperl-discuss ------------------------------------------------------- This SF.Net email sponsored by: Free pre-built ASP.NET sites including Data Reports, E-commerce, Portals, and Forums are available now. Download today and enter to win an XBOX or Visual Studio .NET. http://aspnet.click-url.com/go/psa00100006ave/direct;at.asp_061203_01/01 _______________________________________________ Expectperl-discuss mailing list Exp...@li... https://lists.sourceforge.net/lists/listinfo/expectperl-discuss |
From: <db...@CT...> - 2003-07-07 15:16:03
|
For what it's worth, I only get one print of the string instead of two on both my setups, which are as follows: Setup #1: OS=Redhat Linux 7.3 IO::Tty= version 1.02 Perl=5.6.1 Expect.pm= 1.15 Setup #2: OS=Solaris 7 (Sparc 4500) IO::Tty= version 1.02 Perl=5.8.0 Expect.pm= 1.15 Chris Muth <mut...@mc...> Sent by: To: Exp...@li... exp...@li...urc cc: eforge.net Subject: [Expectperl-discuss] Double prints to screen from one print statement? 07/06/2003 09:47 PM Hey, I have been having trouble with print statements in my perl scripts printing to the screen twice. They are just standard print statements to STDOUT, not much to do with Expect. As seen in the fragment below the print before the call to spawn() will get be seen in the output twice, and the one below will be seen in the output once. Is this a bug, or is this just an idiosyncrasy that one must simply make allowances for? Thanks, Chris #!/usr/bin/perl -w # # use Expect; $exp = new Expect; $exp->raw_pty(1); # Above spawn() we see it twice. print "<you will see this string twice >"; $exp->spawn("/bin/ls"); # Below spawn() we see it once. print "<you will see this string once >"; print "\n"; # EOF ------------------------------------------------------- This SF.Net email sponsored by: Free pre-built ASP.NET sites including Data Reports, E-commerce, Portals, and Forums are available now. Download today and enter to win an XBOX or Visual Studio .NET. http://aspnet.click-url.com/go/psa00100006ave/direct;at.asp_061203_01/01 _______________________________________________ Expectperl-discuss mailing list Exp...@li... https://lists.sourceforge.net/lists/listinfo/expectperl-discuss |
From: Chris M. <mut...@mc...> - 2003-07-07 01:48:53
|
Hey, I have been having trouble with print statements in my perl scripts printing to the screen twice. They are just standard print statements to STDOUT, not much to do with Expect. As seen in the fragment below the print before the call to spawn() will get be seen in the output twice, and the one below will be seen in the output once. Is this a bug, or is this just an idiosyncrasy that one must simply make allowances for? Thanks, Chris #!/usr/bin/perl -w # # use Expect; $exp = new Expect; $exp->raw_pty(1); # Above spawn() we see it twice. print "<you will see this string twice >"; $exp->spawn("/bin/ls"); # Below spawn() we see it once. print "<you will see this string once >"; print "\n"; # EOF |
From: Roland G. <RGi...@cp...> - 2003-06-25 11:58:53
|
How about asking the author of Net::FTP::Recursive? Quoting Srinivasan <uva...@sh...>: > > I am using Net::FTP::Recursive Perl Module to transfer some > directories > from one server to the another. When i am using the script which has > the > above module it is running properly, but if i put the same in the > Crontab it is giving the below error. > > Can't call method "isPlainFile" on an undefined value at > /usr/local/lib/perl5/site_perl/5.8.0/Net/FTP/Recursive.pm line 248. > > Is anyone familiar with the above problem or of the same nature, > please > help me out. it is quite urgent. > > Thanks in Advance > Srini V. > ******** > > > > > ------------------------------------------------------- > This SF.Net email is sponsored by: INetU > Attention Web Developers & Consultants: Become An INetU Hosting > Partner. > Refer Dedicated Servers. We Manage Them. You Get 10% Monthly > Commission! > INetU Dedicated Managed Hosting > http://www.inetu.net/partner/index.php > _______________________________________________ > Expectperl-discuss mailing list > Exp...@li... > https://lists.sourceforge.net/lists/listinfo/expectperl-discuss > -- RGi...@cp... |
From: Srinivasan <uva...@sh...> - 2003-06-25 11:46:13
|
I am using Net::FTP::Recursive Perl Module to transfer some directories from one server to the another. When i am using the script which has the above module it is running properly, but if i put the same in the Crontab it is giving the below error. Can't call method "isPlainFile" on an undefined value at /usr/local/lib/perl5/site_perl/5.8.0/Net/FTP/Recursive.pm line 248. Is anyone familiar with the above problem or of the same nature, please help me out. it is quite urgent. Thanks in Advance Srini V. ******** |
From: Srinivasan <uva...@sh...> - 2003-06-24 14:51:02
|
I am using Net::FTP::Recursive Perl Module to transfer some list of directories with the files under it. It happens recursively internally through the function _rput in the perl module. But i want the same to be done through my control in the script. is it possible. Can anyone used this, please help me out -- Regards Srini V. ******** |
From: Roland G. <RGI...@cp...> - 2003-06-19 16:23:46
|
> Could someone explain to me the difference, if any, between: > > $e->raw_pty(1); > > and > > $e->slave->stty('raw'); Well, the main difference is that you can use raw_pty without pulling in IO::Stty, that's why I added it. And of course that you can specify it before the pty gets allocated and used. This prevents a race that the spawned program would start generating output which gets mangled by the pty before the parent has time to set the pty to raw. Hope this helps, Roland |
From: Kit S. <uni...@iw...> - 2003-06-18 18:50:40
|
I apprecate the help, but unfortunatly the output remains with your line added directly below use Expect; it just seems so weird, from what i think im doing in the code, that output (/usr/bin/last -5 $username) should be logged to /dev/null but instead it is going to &formatoutput.... seriously though i really apprecate the help and advise i recieve on this. On Wed, 18 Jun 2003 db...@CT... wrote: > > Just a hunch: try setting $Expect::Log_Stdout=0; and see if the problem > still remains. > > > > > > > Kit Stube <uni...@iw...> > Sent by: To: exp...@li... > exp...@li...urc cc: > eforge.net Subject: Re: [Expectperl-discuss] problems > with logging > > 06/18/2003 10:13 AM > > > > > > > sorry for the unclear problem report, the problem i am having is the > output from the /usr/bin/last is showing up in the log (which i have maped > to a function so i can fiddle with it a bit before dumping it in a > file) there are also other things showing up, for example bin/sh appears, > i have placed my code at the bottom of this email. > > and i apprecate the suggestion on net::telnet, i am currently printing the > documentation on so that i can review its implementation. > > i thank you for your time and suggestions, they are all apprecated and > considered. > > On Tue, 17 Jun 2003, expect wrote: > > > On Tue, 17 Jun 2003 15:05:35 -0500 (CDT) > > Kit Stube <uni...@iw...> wrote: > > > > > I am having difficulty controling how expectperl is dumping output to > the > > > log file. > > > > > > First you should really use Net::Telnet and second you really haven't > defined > > your problem. Saying that you're "having difficulty" isn't telling > anyone > > enough. Is the file empty? Does have only part of what you expect it to > have? > > Is the remote machine not printing back the data? > > > > And third try Net::Telnet ;^) > > > > > > > > i get the cat /etc/passwd like i desire but i also get the launching of > > > bin/sh the prompt and the last which i do not desire (this is just a > dummy > > > program to solve the exact same problem in my larger one so ignore the > why > > > would you want to of the /usr/bin/last), i have tried everything i can > > > think of and still no idea why it is broken, any thoughts? > > > > > > > > > ----code----- > > > > > > > > > #!/usr/bin/perl -w > > > use strict; > > > use Expect; > > > > > > $|++; > > > > > > #open STDERR, "/dev/null"; > > > > > > my $username="testuser"; > > > my $password="password"; > > > my $host="localhost"; > > > > > > my $timeout=4; > > > > > > my $exp = new Expect; > > > > > > #$exp->debug(3); > > > > > > $exp->log_file("/dev/null"); > > > $exp->log_file(undef); > > > > > > print "Content-type: text/html\n\n<html>"; > > > > > > telnet_login($username,$password,$host,\$exp); > > > > > > $exp->expect($timeout, > > > ['ncorrect', > > > sub { print "<center>ERROR:<br>Login Incorrect, check > username or password</center>\n"; &html_stop; die; } ], > > > [timeout => > > > sub { > > > $exp->send("/bin/sh\n"); > > > $exp->send("/usr/bin/last -5 $username\n"); > > > > > > $exp->clear_accum(); > > > $exp->log_file(\&formatoutput); > > > > > > $exp->send("/bin/cat /etc/passwd\n"); > > > > > > $exp->log_file(undef); > > > } > > > ], > > > ); > > > > > > $exp->soft_close(); > > > > > > print "</html>\n"; > > > > > > sub formatoutput { > > > my $input = shift; > > > > > > chomp($input); > > > $input =~ tr/\r//; > > > $input =~ s|\n|<br>\n|g; > > > > > > print $input; > > > } > > > > > > sub telnet_login > > > { > > > my ($username, $password, $host, $exp) = @_; > > > > > > $$exp->raw_pty(1); #treat this terminal as a raw file > > > $$exp->log_stdout(0); #do not show terminal output to STDOUT > > > > > > $$exp->spawn("/usr/bin/telnet $host") || die "Cannot open > telnet\n"; > > > > > > $$exp->expect(7, > > > ['ogin:', sub { > > > $$exp->send("$username\n"); exp_continue; } ], > > > ['assword:', sub { $$exp->send("$password\n"); } ], > > > [timeout => sub { die "<center>ERROR: <BR>A timeout > has occured at login</center>\n"; } ], > > > ); > > > } > > > > > > > > ------------------------------------------------------- > This SF.Net email is sponsored by: INetU > Attention Web Developers & Consultants: Become An INetU Hosting Partner. > Refer Dedicated Servers. We Manage Them. You Get 10% Monthly Commission! > INetU Dedicated Managed Hosting http://www.inetu.net/partner/index.php > _______________________________________________ > Expectperl-discuss mailing list > Exp...@li... > https://lists.sourceforge.net/lists/listinfo/expectperl-discuss > > > > > |
From: <db...@CT...> - 2003-06-18 18:42:33
|
Just a hunch: try setting $Expect::Log_Stdout=0; and see if the problem still remains. Kit Stube <uni...@iw...> Sent by: To: exp...@li... exp...@li...urc cc: eforge.net Subject: Re: [Expectperl-discuss] problems with logging 06/18/2003 10:13 AM sorry for the unclear problem report, the problem i am having is the output from the /usr/bin/last is showing up in the log (which i have maped to a function so i can fiddle with it a bit before dumping it in a file) there are also other things showing up, for example bin/sh appears, i have placed my code at the bottom of this email. and i apprecate the suggestion on net::telnet, i am currently printing the documentation on so that i can review its implementation. i thank you for your time and suggestions, they are all apprecated and considered. On Tue, 17 Jun 2003, expect wrote: > On Tue, 17 Jun 2003 15:05:35 -0500 (CDT) > Kit Stube <uni...@iw...> wrote: > > > I am having difficulty controling how expectperl is dumping output to the > > log file. > > > First you should really use Net::Telnet and second you really haven't defined > your problem. Saying that you're "having difficulty" isn't telling anyone > enough. Is the file empty? Does have only part of what you expect it to have? > Is the remote machine not printing back the data? > > And third try Net::Telnet ;^) > > > > > i get the cat /etc/passwd like i desire but i also get the launching of > > bin/sh the prompt and the last which i do not desire (this is just a dummy > > program to solve the exact same problem in my larger one so ignore the why > > would you want to of the /usr/bin/last), i have tried everything i can > > think of and still no idea why it is broken, any thoughts? > > > > > > ----code----- > > > > > > #!/usr/bin/perl -w > > use strict; > > use Expect; > > > > $|++; > > > > #open STDERR, "/dev/null"; > > > > my $username="testuser"; > > my $password="password"; > > my $host="localhost"; > > > > my $timeout=4; > > > > my $exp = new Expect; > > > > #$exp->debug(3); > > > > $exp->log_file("/dev/null"); > > $exp->log_file(undef); > > > > print "Content-type: text/html\n\n<html>"; > > > > telnet_login($username,$password,$host,\$exp); > > > > $exp->expect($timeout, > > ['ncorrect', > > sub { print "<center>ERROR:<br>Login Incorrect, check username or password</center>\n"; &html_stop; die; } ], > > [timeout => > > sub { > > $exp->send("/bin/sh\n"); > > $exp->send("/usr/bin/last -5 $username\n"); > > > > $exp->clear_accum(); > > $exp->log_file(\&formatoutput); > > > > $exp->send("/bin/cat /etc/passwd\n"); > > > > $exp->log_file(undef); > > } > > ], > > ); > > > > $exp->soft_close(); > > > > print "</html>\n"; > > > > sub formatoutput { > > my $input = shift; > > > > chomp($input); > > $input =~ tr/\r//; > > $input =~ s|\n|<br>\n|g; > > > > print $input; > > } > > > > sub telnet_login > > { > > my ($username, $password, $host, $exp) = @_; > > > > $$exp->raw_pty(1); #treat this terminal as a raw file > > $$exp->log_stdout(0); #do not show terminal output to STDOUT > > > > $$exp->spawn("/usr/bin/telnet $host") || die "Cannot open telnet\n"; > > > > $$exp->expect(7, > > ['ogin:', sub { > > $$exp->send("$username\n"); exp_continue; } ], > > ['assword:', sub { $$exp->send("$password\n"); } ], > > [timeout => sub { die "<center>ERROR: <BR>A timeout has occured at login</center>\n"; } ], > > ); > > } > > ------------------------------------------------------- This SF.Net email is sponsored by: INetU Attention Web Developers & Consultants: Become An INetU Hosting Partner. Refer Dedicated Servers. We Manage Them. You Get 10% Monthly Commission! INetU Dedicated Managed Hosting http://www.inetu.net/partner/index.php _______________________________________________ Expectperl-discuss mailing list Exp...@li... https://lists.sourceforge.net/lists/listinfo/expectperl-discuss |
From: Austin S. <te...@of...> - 2003-06-18 18:21:43
|
On Wed, Jun 18, 2003 at 12:17:53PM -0400, Jason Penney wrote: > Hi, > > Could someone explain to me the difference, if any, between: > > $e->raw_pty(1); > > and > > $e->slave->stty('raw'); > > Sorry if I'm missing something obvious, but I don't really understand > from the doc. > raw_pty() causes IO::Tty::set_raw() to be called during spawn. stty() causes IO::stty::stty() to be called immediately. From IO::Tty::set_raw: <snip> $termios->setiflag(0); $termios->setoflag(0); $termios->setlflag(0); $termios->setcc(&POSIX::VMIN, 1); $termios->setcc(&POSIX::VTIME, 0); </snip> From IO::Stty: <snip> if($parameter eq 'raw' || $parameter eq '-cooked') { push (@parameters,'-ignbrk','-brkint','-ignpar','-parmrk','-inpck', '-istrip','-inlcr','-igncr','-icrnl','-ixon','-ixoff', '-opost','-isig','-icanon','min',1,'time',0 ); next; } <snip> It's difficult to tell if they do the same thing. For the IO::Stty part, it will only set or unset things defined by POSIX. For example, the only POSIX part of 'oflag' is 'opost'. There may be other undocumented flags that are set by 'setoflag(0)' that may operate differently on different operating systems - or not. I'm not sure if perl traps the part it doesn't recognize. The IO::Stty version is set as such because I followed what the Linux man page stty(1) claimed was 'raw' mode. I'm not sure why the IO::Tty version operates the way it does. In general use the avarage user would _probably_ not be able to tell the difference, but don't quote me on that. Austin |
From: Jason P. <jas...@su...> - 2003-06-18 16:17:11
|
Hi, Could someone explain to me the difference, if any, between: $e->raw_pty(1); and $e->slave->stty('raw'); Sorry if I'm missing something obvious, but I don't really understand from the doc. Thanks, Jay |
From: Kit S. <uni...@iw...> - 2003-06-18 14:13:56
|
sorry for the unclear problem report, the problem i am having is the output from the /usr/bin/last is showing up in the log (which i have maped to a function so i can fiddle with it a bit before dumping it in a file) there are also other things showing up, for example bin/sh appears, i have placed my code at the bottom of this email. and i apprecate the suggestion on net::telnet, i am currently printing the documentation on so that i can review its implementation. i thank you for your time and suggestions, they are all apprecated and considered. On Tue, 17 Jun 2003, expect wrote: > On Tue, 17 Jun 2003 15:05:35 -0500 (CDT) > Kit Stube <uni...@iw...> wrote: > > > I am having difficulty controling how expectperl is dumping output to the > > log file. > > > First you should really use Net::Telnet and second you really haven't defined > your problem. Saying that you're "having difficulty" isn't telling anyone > enough. Is the file empty? Does have only part of what you expect it to have? > Is the remote machine not printing back the data? > > And third try Net::Telnet ;^) > > > > > i get the cat /etc/passwd like i desire but i also get the launching of > > bin/sh the prompt and the last which i do not desire (this is just a dummy > > program to solve the exact same problem in my larger one so ignore the why > > would you want to of the /usr/bin/last), i have tried everything i can > > think of and still no idea why it is broken, any thoughts? > > > > > > ----code----- > > > > > > #!/usr/bin/perl -w > > use strict; > > use Expect; > > > > $|++; > > > > #open STDERR, "/dev/null"; > > > > my $username="testuser"; > > my $password="password"; > > my $host="localhost"; > > > > my $timeout=4; > > > > my $exp = new Expect; > > > > #$exp->debug(3); > > > > $exp->log_file("/dev/null"); > > $exp->log_file(undef); > > > > print "Content-type: text/html\n\n<html>"; > > > > telnet_login($username,$password,$host,\$exp); > > > > $exp->expect($timeout, > > ['ncorrect', > > sub { print "<center>ERROR:<br>Login Incorrect, check username or password</center>\n"; &html_stop; die; } ], > > [timeout => > > sub { > > $exp->send("/bin/sh\n"); > > $exp->send("/usr/bin/last -5 $username\n"); > > > > $exp->clear_accum(); > > $exp->log_file(\&formatoutput); > > > > $exp->send("/bin/cat /etc/passwd\n"); > > > > $exp->log_file(undef); > > } > > ], > > ); > > > > $exp->soft_close(); > > > > print "</html>\n"; > > > > sub formatoutput { > > my $input = shift; > > > > chomp($input); > > $input =~ tr/\r//; > > $input =~ s|\n|<br>\n|g; > > > > print $input; > > } > > > > sub telnet_login > > { > > my ($username, $password, $host, $exp) = @_; > > > > $$exp->raw_pty(1); #treat this terminal as a raw file > > $$exp->log_stdout(0); #do not show terminal output to STDOUT > > > > $$exp->spawn("/usr/bin/telnet $host") || die "Cannot open telnet\n"; > > > > $$exp->expect(7, > > ['ogin:', sub { > > $$exp->send("$username\n"); exp_continue; } ], > > ['assword:', sub { $$exp->send("$password\n"); } ], > > [timeout => sub { die "<center>ERROR: <BR>A timeout has occured at login</center>\n"; } ], > > ); > > } > > |
From: expect <ex...@ih...> - 2003-06-18 01:10:30
|
On Tue, 17 Jun 2003 15:05:35 -0500 (CDT) Kit Stube <uni...@iw...> wrote: > I am having difficulty controling how expectperl is dumping output to the > log file. First you should really use Net::Telnet and second you really haven't defined your problem. Saying that you're "having difficulty" isn't telling anyone enough. Is the file empty? Does have only part of what you expect it to have? Is the remote machine not printing back the data? And third try Net::Telnet ;^) > > i get the cat /etc/passwd like i desire but i also get the launching of > bin/sh the prompt and the last which i do not desire (this is just a dummy > program to solve the exact same problem in my larger one so ignore the why > would you want to of the /usr/bin/last), i have tried everything i can > think of and still no idea why it is broken, any thoughts? > > > ----code----- > > > #!/usr/bin/perl -w > use strict; > use Expect; > > $|++; > > #open STDERR, "/dev/null"; > > my $username="testuser"; > my $password="password"; > my $host="localhost"; > > my $timeout=4; > > my $exp = new Expect; > > #$exp->debug(3); > > $exp->log_file("/dev/null"); > $exp->log_file(undef); > > print "Content-type: text/html\n\n<html>"; > > telnet_login($username,$password,$host,\$exp); > > $exp->expect($timeout, > ['ncorrect', > sub { print "<center>ERROR:<br>Login Incorrect, check username or password</center>\n"; &html_stop; die; } ], > [timeout => > sub { > $exp->send("/bin/sh\n"); > $exp->send("/usr/bin/last -5 $username\n"); > > $exp->clear_accum(); > $exp->log_file(\&formatoutput); > > $exp->send("/bin/cat /etc/passwd\n"); > > $exp->log_file(undef); > } > ], > ); > > $exp->soft_close(); > > print "</html>\n"; > > sub formatoutput { > my $input = shift; > > chomp($input); > $input =~ tr/\r//; > $input =~ s|\n|<br>\n|g; > > print $input; > } > > sub telnet_login > { > my ($username, $password, $host, $exp) = @_; > > $$exp->raw_pty(1); #treat this terminal as a raw file > $$exp->log_stdout(0); #do not show terminal output to STDOUT > > $$exp->spawn("/usr/bin/telnet $host") || die "Cannot open telnet\n"; > > $$exp->expect(7, > ['ogin:', sub { > $$exp->send("$username\n"); exp_continue; } ], > ['assword:', sub { $$exp->send("$password\n"); } ], > [timeout => sub { die "<center>ERROR: <BR>A timeout has occured at login</center>\n"; } ], > ); > } |
From: Kit S. <uni...@iw...> - 2003-06-17 20:05:43
|
I am having difficulty controling how expectperl is dumping output to the log file. i get the cat /etc/passwd like i desire but i also get the launching of bin/sh the prompt and the last which i do not desire (this is just a dummy program to solve the exact same problem in my larger one so ignore the why would you want to of the /usr/bin/last), i have tried everything i can think of and still no idea why it is broken, any thoughts? ----code----- #!/usr/bin/perl -w use strict; use Expect; $|++; #open STDERR, "/dev/null"; my $username="testuser"; my $password="password"; my $host="localhost"; my $timeout=4; my $exp = new Expect; #$exp->debug(3); $exp->log_file("/dev/null"); $exp->log_file(undef); print "Content-type: text/html\n\n<html>"; telnet_login($username,$password,$host,\$exp); $exp->expect($timeout, ['ncorrect', sub { print "<center>ERROR:<br>Login Incorrect, check username or password</center>\n"; &html_stop; die; } ], [timeout => sub { $exp->send("/bin/sh\n"); $exp->send("/usr/bin/last -5 $username\n"); $exp->clear_accum(); $exp->log_file(\&formatoutput); $exp->send("/bin/cat /etc/passwd\n"); $exp->log_file(undef); } ], ); $exp->soft_close(); print "</html>\n"; sub formatoutput { my $input = shift; chomp($input); $input =~ tr/\r//; $input =~ s|\n|<br>\n|g; print $input; } sub telnet_login { my ($username, $password, $host, $exp) = @_; $$exp->raw_pty(1); #treat this terminal as a raw file $$exp->log_stdout(0); #do not show terminal output to STDOUT $$exp->spawn("/usr/bin/telnet $host") || die "Cannot open telnet\n"; $$exp->expect(7, ['ogin:', sub { $$exp->send("$username\n"); exp_continue; } ], ['assword:', sub { $$exp->send("$password\n"); } ], [timeout => sub { die "<center>ERROR: <BR>A timeout has occured at login</center>\n"; } ], ); } |