[ale] expect script question

Yong Wang yongwang at mindspring.com
Fri Aug 24 10:28:55 EDT 2001



Thanks to all who responded to my email. To escape +, it take "\\+",
which is a bit surprising. This is not the regular expression I am used
to. In sed, this can be done:

echo "+OK 0 0" | sed -e 's/\+OK \([0-9]*\) \([0-9]*\)/\1:\2/'

Thanks.

On Fri, 24 Aug 2001, Danny Cox wrote:

> Yong,
> 
> Yong Wang wrote:
> >         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"
> >         }
> 
> 	I'm thinking that the first plus '+' is confusing it, as it's a
> "special" char.  Try escaping it....
> 
> -- 
> "Men occasionally stumble over the truth, but most of them pick 
> themselves up and hurry off as if nothing had happened." 
>    -- Winston Churchill 
> 
> Danny
> 

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





More information about the Ale mailing list