Run things with -ex and shellcheck (#4436)

10 files changed