From: David Garamond Date: 2004-05-31T19:55:07+09:00 Subject: Re: elegant way to say "try this thing, one at a time, until condition is met" nobu.nokada@softhome.net wrote: > count = 0 > until unmount("/usr") && unmount("/usr2") > case count += 1 > when 1 > system "/etc/init.d/httpd stop" > system "/etc/init.d/squid stop" > when 2 > kill("rdiff-backup", :TERM) > sleep 3 > when 3 > kill("rdiff-backup", :KILL) > sleep 3 > end > end Thanks to all. I like this one best :-) The 1, 2, 3, ... clearly shows the increasing step (from less to more extreme) which I would take to meet the condition. -- dave