From: Hugh Sasse Staff Elec Eng Date: 2002-02-19T19:11:33+09:00 Subject: Re: expect.rb vs Expect (Tcl)... On Tue, 19 Feb 2002, Yukihiro Matsumoto wrote: > Hi, > > In message "expect.rb vs Expect (Tcl)..." > on 02/02/19, Hugh Sasse Staff Elec Eng writes: > > |Are there plans to improve this funtionality to allow one to expect on > |many patterns, performing actions as appropriate? > > Don't expect too much for 36 lines of code. Here's my own version of No, but if there were plans it would be silly to duplicate work... :-) > expecter, that waits for many patterns. > [...] > Usage: > > expect = Expecter.new > expect.on(/NO CARRIER/) do > exit 1 > end > expect.on(/Exit/) do > exit 1 > end [...] > f = open("|tail -n 0 -f /var/log/messages") > dial > expect.wait(f) That is exactly what I need. I think I will learn quite a bit by studying this one, too. Thank you. Can this go into 1.[78], please? Hugh >