shell do something in a while