[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[ale] expect script question
- Subject: [ale] expect script question
- From: cochrane at mindspring.com (James S. Cochrane)
- Date: Fri, 24 Aug 2001 00:56:27 -0700
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.