Use bash rather than sh so pipefail works