bash loops with multi-statement conditions