Use more idiomatic sh constructs to shorten/clarify code style