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) |
S | M | T | W | T | F | S |
---|---|---|---|---|---|---|
|
|
|
1
|
2
|
3
|
4
(3) |
5
|
6
(1) |
7
|
8
(2) |
9
(2) |
10
(3) |
11
|
12
|
13
(2) |
14
|
15
(1) |
16
(3) |
17
|
18
|
19
|
20
|
21
|
22
(4) |
23
|
24
|
25
|
26
|
27
|
28
(1) |
29
|
30
|
31
|
|
From: Jo R. <jr...@sv...> - 2006-03-28 07:47:21
|
> also forces any identifier to the left of it to be interpreted as a string." Yes. The wonders of Perl. Your code will do something you never dreamed of in the next version of Perl to ship ;-) People wonder why I obsessively quote and use explicit syntax for things which work unquoted and without operations, and this is why. A compiler that makes a best guess as to what I mean is a bad thing. -- Jo Rhett senior geek SVcolo : Silicon Valley Colocation |
From: BassPlayer <bas...@an...> - 2006-03-22 14:22:39
|
Also www.freshmeat.net is a good site. BP Bryan Bueter wrote: > >> Hey guys, >> I'm a bit of a perl newby, just trying to get a script up that I >> can use to log into devices using ssh, just wondering if there are >> any good repositories of scrips of if anyone has some good sample >> scripts I could use to help me along. I have read the perl::Expect >> docs, still a bit confused about the implementation. >> >> Cheers >> Dave >> > > I also maintain a project around Expect you can use without having to > program in perl. If your interested e-mail me directly and I can get you > a copy of the beta graphical tool I. > > Also you can check out the sourceforge link in my sig. > > > Bryan > http://sourceforge.net/projects/rover > > > > ------------------------------------------------------- > This SF.Net email is sponsored by xPML, a groundbreaking scripting > language > that extends applications into web and mobile media. Attend the live > webcast > and join the prime developer group breaking into this new coding > territory! > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642 > _______________________________________________ > Expectperl-discuss mailing list > Exp...@li... > https://lists.sourceforge.net/lists/listinfo/expectperl-discuss > > !DSPAM:442156fc15601227882105! > |
From: Bryan B. <br...@bu...> - 2006-03-22 13:27:35
|
> Hey guys, > I'm a bit of a perl newby, just trying to get a script up that I > can use to log into devices using ssh, just wondering if there are > any good repositories of scrips of if anyone has some good sample > scripts I could use to help me along. I have read the perl::Expect > docs, still a bit confused about the implementation. > > Cheers > Dave > I also maintain a project around Expect you can use without having to program in perl. If your interested e-mail me directly and I can get you a copy of the beta graphical tool I. Also you can check out the sourceforge link in my sig. Bryan http://sourceforge.net/projects/rover |
From: David T. <dav...@ro...> - 2006-03-22 11:56:18
|
Austin, I'm learning Perl anyway, just not far along the process, so I'd prefer to get that going than learn a few languages. -----Original Message----- From: Austin Schutz [mailto:te...@of...]=20 Sent: Wednesday, 22 March 2006 8:22 PM To: David Taylor Cc: exp...@li... Subject: Re: [Expectperl-discuss] Logging into routers using ssh On Wed, Mar 15, 2006 at 02:15:35PM +1100, David Taylor wrote: > Hey guys, > I'm a bit of a perl newby, just trying to get a script up that > I can use to log into devices using ssh, just wondering if there are=20 > any good repositories of scrips of if anyone has some good sample=20 > scripts I could use to help me along. I have read the perl::Expect=20 > docs, still a bit confused about the implementation. The login scripts that come with rancid (http://www.shrubbery.net/rancid/) may work better for you than trying to learn a new language, unless you are doing compled customization. Trying to learn perl by working your way through the Expect docs is probably not the best way to get an introduction to the language. Austin |
From: Austin S. <te...@of...> - 2006-03-22 09:22:46
|
On Wed, Mar 15, 2006 at 02:15:35PM +1100, David Taylor wrote: > Hey guys, > I'm a bit of a perl newby, just trying to get a script up that I can use to log into devices using ssh, just wondering if there are any good repositories of scrips of if anyone has some good sample scripts I could use to help me along. I have read the perl::Expect docs, still a bit confused about the implementation. The login scripts that come with rancid (http://www.shrubbery.net/rancid/) may work better for you than trying to learn a new language, unless you are doing compled customization. Trying to learn perl by working your way through the Expect docs is probably not the best way to get an introduction to the language. Austin |
From: Kai H. <kai...@al...> - 2006-03-16 22:39:40
|
=20 <scratch head> I thought =3D> was a synonym for a comma. Your example = shows them to be different. <shrug> Might as well try it. <clickety> = There, quotes around 'eof'....=20 Hey! It works! <Thump of Programming Perl hitting the desk> <page flip> Operators.... = <pages flip> ... Comma Operators.... "The =3D> diagraph ... also forces = any identifier to the left of it to be interpreted as a string." Aah.... <chuckle> Light dawns. Thank you Joao, you are exactly correct. - Kai > -----Original Message----- > From: Joao Lopes [mailto:dev...@st...]=20 > Sent: Thursday, March 16, 2006 1:58 PM > To: Kai Hintze > Cc: exp...@li... > Subject: Re: [Expectperl-discuss] eof becomes 1 >=20 > I'm not the expert here but... I think you=B4re getting the function=20 > "eof()" instead of the literal 'eof' (special sequence for Expect)... > Try: > [ 'eof', sub { ... } ], > Or > [ eof =3D> sub { ... } ], >=20 > -- > Joao Lopes >=20 > >=20 > >If I've sent this multiple times I apologize, but I keep getting a > >response from postmaster that it was rejected.... > > > >Greetings Oh Expectators! > >=20 > >I've tracked down my unexpected end to the correct stanza=20 > and immediate > >cause. Now I need some help getting around it. > >=20 > >I have a fairly lengthy expect statement with this stanza at the end: > > [ eof, > > sub { > > print "\n\nExpect EOF: Unexpected end of $spawn_method > >session.\n\n"; > > sleep 2; > > } > > ], > > </quote> > >=20 > >This stanza gets translated to this phrase when the program runs > >(exp_internal(1)): > > #9: -re `1' > ></quote> > >=20 > >The literal '1' matches any random 1 that comes through, making the > >program think it has found an EOF. How do I get around this? > >=20 > >I suppose that I could not test for EOF, but I would like to=20 > know if the > >spawned program died out from under me. How are other people handling > >this? Or is my syntax wrong? > >=20 > >Expect 1.15 under perl 5.8.0 on linux. > >=20 > >Thanks, > >Kai > > > > > >------------------------------------------------------- > >This SF.Net email is sponsored by xPML, a groundbreaking=20 > scripting language > >that extends applications into web and mobile media. Attend=20 > the live webcast > >and join the prime developer group breaking into this new=20 > coding territory! > = >http://sel.as-us.falkag.net/sel?cmd=3Dk&kid=110944&bid$1720&dat=121642 > >_______________________________________________ > >Expectperl-discuss mailing list > >Exp...@li... > >https://lists.sourceforge.net/lists/listinfo/expectperl-discuss > > > > > > =20 > > >=20 >=20 |
From: Joao L. <dev...@st...> - 2006-03-16 20:58:31
|
I'm not the expert here but... I think you´re getting the function "eof()" instead of the literal 'eof' (special sequence for Expect)... Try: [ 'eof', sub { ... } ], Or [ eof => sub { ... } ], -- Joao Lopes > >If I've sent this multiple times I apologize, but I keep getting a >response from postmaster that it was rejected.... > >Greetings Oh Expectators! > >I've tracked down my unexpected end to the correct stanza and immediate >cause. Now I need some help getting around it. > >I have a fairly lengthy expect statement with this stanza at the end: > [ eof, > sub { > print "\n\nExpect EOF: Unexpected end of $spawn_method >session.\n\n"; > sleep 2; > } > ], > </quote> > >This stanza gets translated to this phrase when the program runs >(exp_internal(1)): > #9: -re `1' ></quote> > >The literal '1' matches any random 1 that comes through, making the >program think it has found an EOF. How do I get around this? > >I suppose that I could not test for EOF, but I would like to know if the >spawned program died out from under me. How are other people handling >this? Or is my syntax wrong? > >Expect 1.15 under perl 5.8.0 on linux. > >Thanks, >Kai > > >------------------------------------------------------- >This SF.Net email is sponsored by xPML, a groundbreaking scripting language >that extends applications into web and mobile media. Attend the live webcast >and join the prime developer group breaking into this new coding territory! >http://sel.as-us.falkag.net/sel?cmd=k&kid0944&bid$1720&dat1642 >_______________________________________________ >Expectperl-discuss mailing list >Exp...@li... >https://lists.sourceforge.net/lists/listinfo/expectperl-discuss > > > > |
From: Kai H. <kai...@al...> - 2006-03-16 18:10:34
|
=20 If I've sent this multiple times I apologize, but I keep getting a response from postmaster that it was rejected.... Greetings Oh Expectators! =20 I've tracked down my unexpected end to the correct stanza and immediate cause. Now I need some help getting around it. =20 I have a fairly lengthy expect statement with this stanza at the end: [ eof, sub { print "\n\nExpect EOF: Unexpected end of $spawn_method session.\n\n"; sleep 2; } ], </quote> =20 This stanza gets translated to this phrase when the program runs (exp_internal(1)): #9: -re `1' </quote> =20 The literal '1' matches any random 1 that comes through, making the program think it has found an EOF. How do I get around this? =20 I suppose that I could not test for EOF, but I would like to know if the spawned program died out from under me. How are other people handling this? Or is my syntax wrong? =20 Expect 1.15 under perl 5.8.0 on linux. =20 Thanks, Kai |
From: David T. <dav...@ro...> - 2006-03-15 03:07:18
|
Hey guys, I'm a bit of a perl newby, just trying to get a script up that I = can use to log into devices using ssh, just wondering if there are any = good repositories of scrips of if anyone has some good sample scripts I = could use to help me along. I have read the perl::Expect docs, still a = bit confused about the implementation. Cheers Dave=20 |
From: Jo R. <jr...@sv...> - 2006-03-13 20:32:33
|
On Fri, Mar 10, 2006 at 02:37:36PM +0100, Roland Giersig wrote: > Expect collects all output into a buffer (the accumulator) and matches > against that. This is the mindset you should program in: you have a > string with multiple lines in it. > > So here are a few rules: > > To match a line, use "^.*\n". Note that "." will not match a newline > until you use single-line matching (the option or "(?s)"). My syntax reading fouled up, and I'm confused. "the option" is what? And what did you mean by "(?s)" My first read was using ? for smallest match (ie "(.*?)\n"), but now I'm not so sure. > Note that "\s" WILL match a newline, so it gives unexpected results with > empty lines (as you have already found out). Use "[ \t]" instead. > > To match against the end of buffer (which IMHO is a bad idea), use "\z". > > Don't use "$" or "\Z", instead always anchor your patterns at the start > of the line. Anchoring at the start of the line is fine, but how to properly detect the end of the line is the question. Lines where I know the start but don't know the end (and thus need to find and output the lines) is the issue. /^[ \t]+Line starts with(.*?)[\r\n]+/ ..doesn't seem to work /^[ \t]+Line starts with(.*?)$/ .. does work, but can also match a partial line in the accumulator. /^[ \t]+Line starts with(.*?)\r+$/ .. does work In short, I'm not convinced that \n is actually matching right now. And this all makes sense, but goes explicitly against the documentation that says that line-matching can be done with ^ and $. It seems likely that the documentation is out of date, but... -- Jo Rhett senior geek SVcolo : Silicon Valley Colocation |
From: Roland G. <RGi...@cp...> - 2006-03-13 11:46:32
|
Hi Kevin, I don't see what this has to do with Expect, but I'm in a generous mood today... :o) Your script is working just fine, a .doc (which is probably a Word-document) is a binary format with lots of strange characters in it. Hope this helps, Roland Quoting manofwax <man...@ho...>: > > Hello, > > I'm trying to write a script so that it can search through some > specific > item from all of the files in one directory. I'm able to do this only > if these files are regular text file without any format. However, when I > ran my > script on some .doc file with tables, special characters, and some > content which has restriction on copy and paste, my script failed. > > I think my script couldn't read in these special character correctly. > This is how I read the file: > > open(INFILE, $fName) || die("Could not open file!"); > @junk =3D <INFILE>; > close(INFILE); > > I tried to see what my script read by outputing the @junk to a file, > I got > something like this: > > =C3=90=C3=8F=11=C3=A0=C2=A1=C2=B1=1A=C3=A1 > =03 > =C3=BE=C3= > =BF=09 =06 =01 =11=19 4=0C =20 > z=02 =14 =C2=90=C5=93=C3=BBp=C3=A3 =C3=85=012=01 2=01 > =E2=80= > =98=12 =1C:=07=13 FORMTEXT =01=143/4/05=15=07REV:=07=13 FORMTEXT=07 > > Do you know how I can read this file correctly?? Thanks a lot. > > Kevin > > -- > View this message in context: > http://www.nabble.com/How-to-read-a-file-with= > -special-format-and-character-t1260855.html#a3345144 > Sent from the Perl - Expectperl-Discuss forum at Nabble.com. > > > > ------------------------------------------------------- > This SF.Net email is sponsored by xPML, a groundbreaking scripting > language > that extends applications into web and mobile media. Attend the live > webcast > and join the prime developer group breaking into this new coding > territory! > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642 > _______________________________________________ > Expectperl-discuss mailing list > Exp...@li... > https://lists.sourceforge.net/lists/listinfo/expectperl-discuss > -- RGi...@cp... |
From: manofwax <man...@ho...> - 2006-03-10 19:14:11
|
Hello, I'm trying to write a script so that it can search through some specific item from all of the files in one directory. I'm able to do this only if these files are regular text file without any format. However, when I ran m= y script on some .doc file with tables, special characters, and some content which has restriction on copy and paste, my script failed. I think my script couldn't read in these special character correctly. This is how I read the file: open(INFILE, $fName) || die("Could not open file!"); @junk =3D <INFILE>; close(INFILE); I tried to see what my script read by outputing the @junk to a file, I got something like this: =C3=90=C3=8F=11=C3=A0=C2=A1=C2=B1=1A=C3=A1 > =03 =C3=BE=C3= =BF=09 =06 =01 =11=19 4=0C =20 z=02 =14 =C2=90=C5=93=C3=BBp=C3=A3 =C3=85=012=01 2=01 =E2=80= =98=12 =1C:=07=13 FORMTEXT =01=143/4/05=15=07REV:=07=13 FORMTEXT=07 Do you know how I can read this file correctly?? Thanks a lot. Kevin -- View this message in context: http://www.nabble.com/How-to-read-a-file-with= -special-format-and-character-t1260855.html#a3345144 Sent from the Perl - Expectperl-Discuss forum at Nabble.com. |
From: Roland G. <RGi...@cp...> - 2006-03-10 13:37:57
|
Expect collects all output into a buffer (the accumulator) and matches against that. This is the mindset you should program in: you have a string with multiple lines in it. So here are a few rules: To match a line, use "^.*\n". Note that "." will not match a newline until you use single-line matching (the option or "(?s)"). Note that "\s" WILL match a newline, so it gives unexpected results with empty lines (as you have already found out). Use "[ \t]" instead. To match against the end of buffer (which IMHO is a bad idea), use "\z". Don't use "$" or "\Z", instead always anchor your patterns at the start of the line. Hope this helps, Roland Quoting Jo Rhett <jr...@sv...>: > Obviously I will test, but the description is > > \Z - Matches only at the end of a string or before a newline > \z - Matches only at the end of a string > > What is "a string" in this context? In my coding brain, the entire > buffer is a string... if it means the entire buffer, then this is exactly > the opposite of what I want. I want a newline but NOT the end of the > buffer... > > On Thu, Mar 09, 2006 at 10:08:45AM -0500, Chris Snyder wrote: > > Have you looked at \z and \Z as to whether they satisfy your needs? > > > > Page 179 of the camel book, 3rd edition. > > > > On Thu, 2006-03-09 at 01:25 -0800, Jo Rhett wrote: > > > I'm having some difficulty with some expect sequences that I > finally > > > figured out, but others may run into this. The documentations > says that > > > ^ will match the beginning of a line, and $ match the end... but > $ also > > > matches the end of the buffer, so unless the far side is > outputting a \r in > > > addition to a linefeed, it can be pretty tough trying to match a > specific > > > line. (watch in debug, and often a buffer ends mid-line...) > > > > > > I'm also seeing scenaries where /^\s+(Text)$/ will match across > multiple > > > linefeeds prior to finding "Text". Like "\n\n\nText\n". > > > > > > Are there some delimiters that can be useful to match end of line > but not > > > end of buffer? And any way to guarantee that /^...$/ stays on a > single > > > line? > > > > > > I'm using /^[ \t]+Text\r$/ and it meets my needs for the current > situation, > > > but some of the things I'm working with won't output carriage > returns so... > > > > > -- > Jo Rhett > senior geek > SVcolo : Silicon Valley Colocation > > > ------------------------------------------------------- > This SF.Net email is sponsored by xPML, a groundbreaking scripting > language > that extends applications into web and mobile media. Attend the live > webcast > and join the prime developer group breaking into this new coding > territory! > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642 > _______________________________________________ > Expectperl-discuss mailing list > Exp...@li... > https://lists.sourceforge.net/lists/listinfo/expectperl-discuss > -- RGi...@cp... |
From: Jo R. <jr...@sv...> - 2006-03-10 13:08:14
|
Obviously I will test, but the description is \Z - Matches only at the end of a string or before a newline \z - Matches only at the end of a string What is "a string" in this context? In my coding brain, the entire buffer is a string... if it means the entire buffer, then this is exactly the opposite of what I want. I want a newline but NOT the end of the buffer... On Thu, Mar 09, 2006 at 10:08:45AM -0500, Chris Snyder wrote: > Have you looked at \z and \Z as to whether they satisfy your needs? > > Page 179 of the camel book, 3rd edition. > > On Thu, 2006-03-09 at 01:25 -0800, Jo Rhett wrote: > > I'm having some difficulty with some expect sequences that I finally > > figured out, but others may run into this. The documentations says that > > ^ will match the beginning of a line, and $ match the end... but $ also > > matches the end of the buffer, so unless the far side is outputting a \r in > > addition to a linefeed, it can be pretty tough trying to match a specific > > line. (watch in debug, and often a buffer ends mid-line...) > > > > I'm also seeing scenaries where /^\s+(Text)$/ will match across multiple > > linefeeds prior to finding "Text". Like "\n\n\nText\n". > > > > Are there some delimiters that can be useful to match end of line but not > > end of buffer? And any way to guarantee that /^...$/ stays on a single > > line? > > > > I'm using /^[ \t]+Text\r$/ and it meets my needs for the current situation, > > but some of the things I'm working with won't output carriage returns so... > > -- Jo Rhett senior geek SVcolo : Silicon Valley Colocation |
From: Chris S. <cas...@pe...> - 2006-03-09 15:09:07
|
Have you looked at \z and \Z as to whether they satisfy your needs? Page 179 of the camel book, 3rd edition. On Thu, 2006-03-09 at 01:25 -0800, Jo Rhett wrote: > I'm having some difficulty with some expect sequences that I finally > figured out, but others may run into this. The documentations says that > ^ will match the beginning of a line, and $ match the end... but $ also > matches the end of the buffer, so unless the far side is outputting a \r in > addition to a linefeed, it can be pretty tough trying to match a specific > line. (watch in debug, and often a buffer ends mid-line...) > > I'm also seeing scenaries where /^\s+(Text)$/ will match across multiple > linefeeds prior to finding "Text". Like "\n\n\nText\n". > > Are there some delimiters that can be useful to match end of line but not > end of buffer? And any way to guarantee that /^...$/ stays on a single > line? > > I'm using /^[ \t]+Text\r$/ and it meets my needs for the current situation, > but some of the things I'm working with won't output carriage returns so... > |
From: Jo R. <jr...@sv...> - 2006-03-09 09:25:54
|
I'm having some difficulty with some expect sequences that I finally figured out, but others may run into this. The documentations says that ^ will match the beginning of a line, and $ match the end... but $ also matches the end of the buffer, so unless the far side is outputting a \r in addition to a linefeed, it can be pretty tough trying to match a specific line. (watch in debug, and often a buffer ends mid-line...) I'm also seeing scenaries where /^\s+(Text)$/ will match across multiple linefeeds prior to finding "Text". Like "\n\n\nText\n". Are there some delimiters that can be useful to match end of line but not end of buffer? And any way to guarantee that /^...$/ stays on a single line? I'm using /^[ \t]+Text\r$/ and it meets my needs for the current situation, but some of the things I'm working with won't output carriage returns so... -- Jo Rhett senior geek SVcolo : Silicon Valley Colocation |
From: Kai H. <kai...@al...> - 2006-03-08 19:20:51
|
=20 Summary: I'm trying to use Expect to connect to a box. It acts like it connects and then dies on the first line of the connection. Why? Discussion: WARNING: Long post. Thorough examples. I've read all the documentation (many times!), and a large chunk of the expectperl-discuss archive. That got me through several problems, but I'm stuck on this one. I'm a pretty good perl programmer, and I used the TCL expect for one project a few years back, so I kind of know my way around. I'm sure I'm overlooking something simple, but I can't see it.... I'm trying to automate performing the same process on several hundred boxes. Ideally we have the ssh key for 'auser' on sunbox sent out to all the target boxes, but we can't count on that, so we can't just loop through all the boxes with "ssh command". In fact, some of the boxes will require telnet. Also, we will have to branch depending on OS. So we need a program to manage it all. The first step is to get ssh to connect reliably where it is set up. I'm nearly there, I think. The test 'central' box is sunbox, Solaris 8, perl 5.8.7, Expect 1.15. The first test target is aixbox. I can ssh to the target by hand no problem: myself@sunbox:/home/myself> ssh auser@aixbox auser@aixbox's password: Warning: No xauth data; using fake authentication data for X11 forwarding. Last unsuccessful login: Tue Mar 7 15:45:08 MST 2006 on ssh from sunbox Last login: Tue Mar 7 15:45:10 MST 2006 on ssh from sunbox WARNING Access to Company computer systems is limited to authorized employees. $ exit myself@sunbox:/home/myself>=20 </quote> The subroutine that tries to set up the connection is: sub RemoteLogin { if ($#_ > 0) { print "Programmer error: RemoteLogin needs one parameter, but someone called RemoteLogin(", join(", ", @_), "\n"; return -1; } elsif ($#_ < 0) { print "Programmer error: RemoteLogin to know where to log in, but someone called RemoteLogin without any parameters\n"; return -1; } my ($remote_server) =3D @_; my $use_ssh =3D 1; my $e =3D new Expect; $e->raw_pty(1); $e->log_file("e.log", "w"); $e->print_log_file("Starting attempts to connect to $remote_server\n"); $e->debug(2); $e->exp_internal(1); my $connect_try =3D 3; my $connect_flag =3D 0; while ($connect_try > 0) { if ($use_ssh) { $e->print_log_file("Starting ssh attempt $connect_try\n"); if ( $e->spawn("/usr/local/bin/ssh auser\@$remote_server") ) { $e->expect(30, [ '-re', 'word:', sub { $m_auser_pass =3D &main::get_auser_pass($connect_try--); print "Got auser pass. It is $m_auser_pass\n"; $e->send($m_auser_pass, "\n"); sleep 2; exp_continue; } ], [ '-re', 'please try again', sub { $m_auser_pass =3D &main::get_auser_pass($connect_try--); print "Got auser pass. It is $m_auser_pass\n"; $e->send($m_auser_pass, "\n"); sleep 2; exp_continue; } ], [ '-re', 'authenticity .* can\'t be established.', sub { sleep 1; $e->send("yes\n"); exp_continue; } ], [ 'name not known', sub { # can't connect here at all. print "$remote_server: Name not recognized. Check spelling.\n"; $e->soft_close(); return -1; #### RETURN } ], [ 'Connection refused', sub { # no ssh receiver. Try telnet $use_ssh =3D 0; } ], [ eof, sub { print "\n\nExpect EOF: Unexpected end of ssh session.\n\n"; } ], [ timeout =3D> sub { print "\n\nExpect timeout: ssh attempt timed out.\n\n"; # no ssh receiver? Try telnet $use_ssh =3D 0; } ], [ '-re', $gPrompt, sub { $connect_try =3D 0; $connect_flag =3D 1; } ], ); # end expect if ($connect_flag) { $gRemoteHost =3D $e; } else { print "\n\nCouldn't connect. Closing now.\n\n"; $e->soft_close(); return -1; } } else { # spawn failed print "\n\nCould not spawn ssh to $remote_server attempt.\n\n"; } # end if spawn ssh } # end if use_ssh } # end while } # end sub RemoteLogin </quote> When I try running the program it looks like it connects but then it claims to have gotten and EOF and dies. I can't figure out why: myself@sunbox:/home/myself> /usr/local/bin/perl -d rlt.pl Loading DB routines from perl5db.pl version 1.28 Editor support available. Enter h or `h h' for help, or `man perldebug' for more help. main::(rlt.pl:36): if (0 <=3D &RemoteLogin('aixbox')) {; DB<1> c Spawned '/usr/local/bin/ssh auser@aixbox' spawn id(6) Pid: 19273 Tty: /dev/pts/4 at /usr/local/lib/perl5/site_perl/5.8.7/Expect.pm line 167 Expect::spawn('Expect=3DGLOB(0x5b1068)', '/usr/local/bin/ssh auser@aixbox') called at TmipRemote.pm line 70 TmipRemote::RemoteLogin('aixbox') called at rlt.pl line 36 at /usr/local/lib/perl5/site_perl/5.8.7/Expect.pm line 167 Expect::spawn('Expect=3DGLOB(0x5b1068)', '/usr/local/bin/ssh auser@aixbox') called at TmipRemote.pm line 70 TmipRemote::RemoteLogin('aixbox') called at rlt.pl line 36 Starting EXPECT pattern matching... at /usr/local/lib/perl5/site_perl/5.8.7/Expect.pm line 532 Expect::expect('Expect=3DGLOB(0x5b1068)', 30, 'ARRAY(0x5c7890)', 'ARRAY(0x5c7704)', 'ARRAY(0x5a4668)', 'ARRAY(0x5a46bc)', 'ARRAY(0x5c057c)', 'ARRAY(0x5c05f4)', 'ARRAY(0x5c05dc)', ...) called at TmipRemote.pm line 126 TmipRemote::RemoteLogin('aixbox') called at rlt.pl line 36 at /usr/local/lib/perl5/site_perl/5.8.7/Expect.pm line 532 Expect::expect('Expect=3DGLOB(0x5b1068)', 30, 'ARRAY(0x5c7890)', 'ARRAY(0x5c7704)', 'ARRAY(0x5a4668)', 'ARRAY(0x5a46bc)', 'ARRAY(0x5c057c)', 'ARRAY(0x5c05f4)', 'ARRAY(0x5c05dc)', ...) called at TmipRemote.pm line 126 TmipRemote::RemoteLogin('aixbox') called at rlt.pl line 36 spawn id(6): list of patterns: #1: -re `word:' #2: -re `please try again' #3: -re `authenticity .* can\'t be established.' #4: -re `name not known' #5: -re `Connection refused' #6: -re `1' #8: -re `[$#>] *$' spawn id(6): Does `' match: pattern #1: -re `word:'? No. pattern #2: -re `please try again'? No. pattern #3: -re `authenticity .* can\'t be established.'? No. pattern #4: -re `name not known'? No. pattern #5: -re `Connection refused'? No. pattern #6: -re `1'? No. pattern #8: -re `[$#>] *$'? No. auser@aixbox's password: spawn id(6): Does `auser@aixbox\'s password: ' match: pattern #1: -re `word:'? YES!! Before match string: `auser@aixbox\'s pass' Match string: `word:' After match string: ` ' Matchlist: () Calling hook CODE(0x5c7df4)... Got auser pass. It is auser99 Sending 'auser99\n' to spawn id(6) at /usr/local/lib/perl5/site_perl/5.8.7/Expect.pm line 1222 Expect::print('Expect=3DGLOB(0x5b1068)', 'auser99', '\x{a}') called at TmipRemote.pm line 76 = TmipRemote::__ANON__[TmipRemote.pm:79]('Expect=3DGLOB(0x5b1068)') called at /usr/local/lib/perl5/site_perl/5.8.7/Expect.pm line 733 Expect::_multi_expect(30, 'ARRAY(0x5c08e8)', 'ARRAY(0x5c0b1c)') called at /usr/local/lib/perl5/site_perl/5.8.7/Expect.pm line 536 Expect::expect('Expect=3DGLOB(0x5b1068)', 30, 'ARRAY(0x5c7890)', 'ARRAY(0x5c7704)', 'ARRAY(0x5a4668)', 'ARRAY(0x5a46bc)', 'ARRAY(0x5c057c)', 'ARRAY(0x5c05f4)', 'ARRAY(0x5c05dc)', ...) called at TmipRemote.pm line 126 TmipRemote::RemoteLogin('aixbox') called at rlt.pl line 36 at /usr/local/lib/perl5/site_perl/5.8.7/Expect.pm line 1222 Expect::print('Expect=3DGLOB(0x5b1068)', 'auser99', '\x{a}') called at TmipRemote.pm line 76 = TmipRemote::__ANON__[TmipRemote.pm:79]('Expect=3DGLOB(0x5b1068)') called at /usr/local/lib/perl5/site_perl/5.8.7/Expect.pm line 733 Expect::_multi_expect(30, 'ARRAY(0x5c08e8)', 'ARRAY(0x5c0b1c)') called at /usr/local/lib/perl5/site_perl/5.8.7/Expect.pm line 536 Expect::expect('Expect=3DGLOB(0x5b1068)', 30, 'ARRAY(0x5c7890)', 'ARRAY(0x5c7704)', 'ARRAY(0x5a4668)', 'ARRAY(0x5a46bc)', 'ARRAY(0x5c057c)', 'ARRAY(0x5c05f4)', 'ARRAY(0x5c05dc)', ...) called at TmipRemote.pm line 126 TmipRemote::RemoteLogin('aixbox') called at rlt.pl line 36 Continuing expect, restarting timeout... spawn id(6): Does ` ' match: pattern #1: -re `word:'? No. pattern #2: -re `please try again'? No. pattern #3: -re `authenticity .* can\'t be established.'? No. pattern #4: -re `name not known'? No. pattern #5: -re `Connection refused'? No. pattern #6: -re `1'? No. pattern #8: -re `[$#>] *$'? No. Permission denied, please try again. auser@aixbox's password: spawn id(6): Does ` \nPermission denied, please try again.\r\nauser@aixbox\'s password: ' match: pattern #1: -re `word:'? YES!! Before match string: ` \nPermission denied, please try again.\r\nauser@aixbox\'s pass' Match string: `word:' After match string: ` ' Matchlist: () Calling hook CODE(0x5c7df4)... Got auser pass. It is newpass Sending 'newpass\n' to spawn id(6) at /usr/local/lib/perl5/site_perl/5.8.7/Expect.pm line 1222 Expect::print('Expect=3DGLOB(0x5b1068)', 'newpass', '\x{a}') called at TmipRemote.pm line 76 = TmipRemote::__ANON__[TmipRemote.pm:79]('Expect=3DGLOB(0x5b1068)') called at /usr/local/lib/perl5/site_perl/5.8.7/Expect.pm line 733 Expect::_multi_expect(30, 'ARRAY(0x5c08e8)', 'ARRAY(0x5c0b1c)') called at /usr/local/lib/perl5/site_perl/5.8.7/Expect.pm line 536 Expect::expect('Expect=3DGLOB(0x5b1068)', 30, 'ARRAY(0x5c7890)', 'ARRAY(0x5c7704)', 'ARRAY(0x5a4668)', 'ARRAY(0x5a46bc)', 'ARRAY(0x5c057c)', 'ARRAY(0x5c05f4)', 'ARRAY(0x5c05dc)', ...) called at TmipRemote.pm line 126 TmipRemote::RemoteLogin('aixbox') called at rlt.pl line 36 at /usr/local/lib/perl5/site_perl/5.8.7/Expect.pm line 1222 Expect::print('Expect=3DGLOB(0x5b1068)', 'newpass', '\x{a}') called at TmipRemote.pm line 76 = TmipRemote::__ANON__[TmipRemote.pm:79]('Expect=3DGLOB(0x5b1068)') called at /usr/local/lib/perl5/site_perl/5.8.7/Expect.pm line 733 Expect::_multi_expect(30, 'ARRAY(0x5c08e8)', 'ARRAY(0x5c0b1c)') called at /usr/local/lib/perl5/site_perl/5.8.7/Expect.pm line 536 Expect::expect('Expect=3DGLOB(0x5b1068)', 30, 'ARRAY(0x5c7890)', 'ARRAY(0x5c7704)', 'ARRAY(0x5a4668)', 'ARRAY(0x5a46bc)', 'ARRAY(0x5c057c)', 'ARRAY(0x5c05f4)', 'ARRAY(0x5c05dc)', ...) called at TmipRemote.pm line 126 TmipRemote::RemoteLogin('aixbox') called at rlt.pl line 36 Continuing expect, restarting timeout... spawn id(6): Does ` ' match: pattern #1: -re `word:'? No. pattern #2: -re `please try again'? No. pattern #3: -re `authenticity .* can\'t be established.'? No. pattern #4: -re `name not known'? No. pattern #5: -re `Connection refused'? No. pattern #6: -re `1'? No. pattern #8: -re `[$#>] *$'? No. spawn id(6): Does ` \n' match: pattern #1: -re `word:'? No. pattern #2: -re `please try again'? No. pattern #3: -re `authenticity .* can\'t be established.'? No. pattern #4: -re `name not known'? No. pattern #5: -re `Connection refused'? No. pattern #6: -re `1'? No. pattern #8: -re `[$#>] *$'? No. Warning: No xauth data; using fake authentication data for X11 forwarding. spawn id(6): Does ` \nWarning: No xauth data; using fake authentication data for X11 forwarding.\r\n' match: pattern #1: -re `word:'? No. pattern #2: -re `please try again'? No. pattern #3: -re `authenticity .* can\'t be established.'? No. pattern #4: -re `name not known'? No. pattern #5: -re `Connection refused'? No. pattern #6: -re `1'? YES!! Before match string: ` \nWarning: No xauth data; using fake authentication data for X' Match string: `1' After match string: `1 forwarding.\r\n' Matchlist: () Calling hook CODE(0x576770)... Expect EOF: Unexpected end of ssh session. Couldn't connect. Closing now. Closing spawn id(6). at /usr/local/lib/perl5/site_perl/5.8.7/Expect.pm line 1309 Expect::soft_close('Expect=3DGLOB(0x5b1068)') called at TmipRemote.pm line 133 TmipRemote::RemoteLogin('aixbox') called at rlt.pl line 36 at /usr/local/lib/perl5/site_perl/5.8.7/Expect.pm line 1309 Expect::soft_close('Expect=3DGLOB(0x5b1068)') called at TmipRemote.pm line 133 TmipRemote::RemoteLogin('aixbox') called at rlt.pl line 36 1 unsuccessful login attempt since last login. Last unsuccessful login: Tue Mar 7 16:08:48 MST 2006 on ssh from sunbox.albertsons.com Last login: Tue Mar 7 15:59:47 MST 2006 on ssh from sunbox.albertsons.com WARNING Access to Company computer systems is limited to authorized employees and other authorized persons affiliated with this Company. All users of Company systems must comply with all Company policies. By accepting and/or signing on to any of the Company's systems, users expressly consent to all of the terms and conditions or policies governing their use. Any unauthorized access of this system or the information it contains will be considered trespassing and is a violation of the law that may subject the violator to civil or criminal sanctions, as well as immediate termination of employment. Help Desk 1-888-767-4227 $ Timed out waiting for an EOF from spawn id(6). spawn id(6) closed. Pid 19273 of spawn id(6) exited, Status: 0x01 Closing spawn id(6). at /usr/local/lib/perl5/site_perl/5.8.7/Expect.pm line 1386 Expect::hard_close('Expect=3DGLOB(0x5b1068)') called at /usr/local/lib/perl5/site_perl/5.8.7/Expect.pm line 1575 Expect::DESTROY('Expect=3DGLOB(0x5b1068)') called at /usr/local/lib/perl5/5.8.7/perl5db.pl line 3742 eval {...} called at /usr/local/lib/perl5/5.8.7/perl5db.pl line 3742 at /usr/local/lib/perl5/site_perl/5.8.7/Expect.pm line 1386 Expect::hard_close('Expect=3DGLOB(0x5b1068)') called at /usr/local/lib/perl5/site_perl/5.8.7/Expect.pm line 1575 Expect::DESTROY('Expect=3DGLOB(0x5b1068)') called at /usr/local/lib/perl5/5.8.7/perl5db.pl line 3742 eval {...} called at /usr/local/lib/perl5/5.8.7/perl5db.pl line 3742 Debugged program terminated. Use q to quit or R to restart, use O inhibit_exit to avoid stopping after program termination, h q, h R or h O to get additional info. DB<1> q myself@sunbox:/home/myself> </quote> So it looks like it connects, but with the first line of successful connection it thinks that it didn't, and dies. I've tried other boxes, in case is it something peculiar to aixbox, but no joy. Suggestions? Thanks, Kai |
From: Roland G. <RGi...@cp...> - 2006-03-08 15:52:38
|
Hmm, you haven't posted the relevant spawn() command, so your example is probably incomplete. But I'd guess that you simply are out-of-sync. You have to start with an "expect($prompt)" to catch the first prompt before "send"ing the first command... Hope this helps, Roland Quoting Solomon Haile <sh...@az...>: > I have a script that sends test commands continuously just expecting > a prompt. > > The problem that I have is, it sends the next command before the > first one > finished. Once the test started there is no prompt in between until > the test completes. > > Here is what I am doing: > > > > $prompt = "APP138:~"; > > my $exp = new Expect; > > > > #The test starts here > > $exp ->send("Test101\r"); > > Sleep 1; > > $exp->expect(90, $prompt); > > > > > > $exp ->send("Test102\r"); > > Sleep 1; > > $exp->expect(90, $prompt); > > ... > > > > The next test starts before "Test101" completed. > > > > Is there anything I have to do to fix this? > > > > Thanks > > -- RGi...@cp... |
From: Austin S. <te...@of...> - 2006-03-06 09:53:02
|
On Fri, Mar 03, 2006 at 06:13:44PM -0800, SolHai Haile wrote: > > I am using Expect the first time and having some problem. > I am runnig a test for some equipment. I am just sending a command and wait > for a a system prompt before the next test is excuted. But it sends all my > test commands before the first one completes. > > This is waht my script looks like: > use Expect; > > my $exp = new Expect; > my $prompt = "App138:"; > $exp->send("Test101 |tee -a /tmp/temp\r"); > sleep 1; > $exp->expect(90, $prompt); > # > $exp->send("Test10 |tee -a /tmp/temp\n"); > sleep 1; > $patidx = $exp->expect(90,$prompt); > ..... > starts "Test101" then immediately prints the next test "Test 102". > How do I wait for the prompt. Is there something that I am doing wrong. > Is there a way also to clear the buffer before the next test. > does $exp->clear_accum(); works? There is likely nothing in the buffer, but setting exp_internal would tell you. Probably either the process has died causing expect to return immediately, or the |tee part of the command is confusing it. I would try with debugging turned on and the |tee part of the command removed. Austin |
From: Johnson, W. R. <wr...@sa...> - 2006-03-04 04:08:21
|
When processing discrete events like this, it is always wise to clear the accumulator before proceeding to the next event. This is especially true if you are 'expecting' the same string from each event (your $prompt). While I'm sure you know if 90 seconds has passed or not, it is always wise to check the match buffer too... if($exp->match() ne $prompt) { die "EEEK"; } $exp->clear_accum(); I'm assuming a lot here, but good luck. -- Wilbur R. Johnson Software Systems Systems Engineering and Analysis Sandia National Laboratories PMTS - Software Research and Development On 3/3/06 7:13 PM, "SolHai Haile" <so...@ms...> wrote: > > I am using Expect the first time and having some problem. > I am runnig a test for some equipment. I am just sending a command and wait > for a a system prompt before the next test is excuted. But it sends all my > test commands before the first one completes. > > This is waht my script looks like: > use Expect; > > my $exp = new Expect; > my $prompt = "App138:"; > $exp->send("Test101 |tee -a /tmp/temp\r"); > sleep 1; > $exp->expect(90, $prompt); > # > $exp->send("Test10 |tee -a /tmp/temp\n"); > sleep 1; > $patidx = $exp->expect(90,$prompt); > ..... > starts "Test101" then immediately prints the next test "Test 102". > How do I wait for the prompt. Is there something that I am doing wrong. > Is there a way also to clear the buffer before the next test. > does $exp->clear_accum(); works? > > I will appreciate for your help. > > > > > ------------------------------------------------------- > This SF.Net email is sponsored by xPML, a groundbreaking scripting language > that extends applications into web and mobile media. Attend the live webcast > and join the prime developer group breaking into this new coding territory! > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642 > _______________________________________________ > Expectperl-discuss mailing list > Exp...@li... > https://lists.sourceforge.net/lists/listinfo/expectperl-discuss > |
From: SolHai H. <so...@ms...> - 2006-03-04 02:13:49
|
I am using Expect the first time and having some problem. I am runnig a test for some equipment. I am just sending a command and wait for a a system prompt before the next test is excuted. But it sends all my test commands before the first one completes. This is waht my script looks like: use Expect; my $exp = new Expect; my $prompt = "App138:"; $exp->send("Test101 |tee -a /tmp/temp\r"); sleep 1; $exp->expect(90, $prompt); # $exp->send("Test10 |tee -a /tmp/temp\n"); sleep 1; $patidx = $exp->expect(90,$prompt); ..... starts "Test101" then immediately prints the next test "Test 102". How do I wait for the prompt. Is there something that I am doing wrong. Is there a way also to clear the buffer before the next test. does $exp->clear_accum(); works? I will appreciate for your help. |
From: Solomon H. <sh...@az...> - 2006-03-04 01:21:38
|
I have a script that sends test commands continuously just expecting a prompt. The problem that I have is, it sends the next command before the first = one finished. Once the test started there is no prompt in between until the = test completes. Here is what I am doing: =20 $prompt =3D "APP138:~"; my $exp =3D new Expect; =20 #The test starts here $exp ->send("Test101\r"); Sleep 1; $exp->expect(90, $prompt); =20 =20 $exp ->send("Test102\r"); Sleep 1; $exp->expect(90, $prompt); ... =20 The next test starts before "Test101" completed. =20 Is there anything I have to do to fix this? =20 Thanks |