More idiomatic bash