[ale] expect script question

James S. Cochrane cochrane at mindspring.com
Fri Aug 24 03:56:27 EDT 2001


I would expect (hah) that expect is griping because you are telling it NOT 
to interpret the '[' where you are looking for numeric strings " 
(\[0-9]*)".  It is probably interpreting that as
\[0-9], which doesn't appear valid.  I'd try:
expect -re "+OK [0-9][0-9] [0-9]*\n" {

Note that I haven't mucked with expect in a while, and am too lazy to go 
pick up my book, but that is the first thing I noticed.

James

At 12:29 AM 8/24/01 -0400, Yong Wang wrote:

>Hi, I am trying to write an expect script to interact with POP mail
>server and I am stuck at the regular expression parsing of "stat" POP
>command. The output string from "stat" is "+OK 12 3456". The following
>expect code just keep complaining about bad regular expression:
>
>         send "stat\n"
>         expect -re "+OK (\[0-9]*) (\[0-9]*)\n" {
>                 send_user "# of messages: $expect_out(1,string)\n"
>         } timeout {
>                 send_user "POP timeout\n"
>         }
>
>Any help would be appreciated. Thanks.
>
>--
>To unsubscribe: mail majordomo at ale.org with "unsubscribe ale" in message 
>body.

--
To unsubscribe: mail majordomo at ale.org with "unsubscribe ale" in message body.





More information about the Ale mailing list