Update the shell scripts to always have a shebang and use whether bash:
#!/usr/bin/env bash
or the system shell:
#!/bin/sh
Other forms will throw an arcanist error at lint time.
Backport of core PR13320, PR13510 and PR14831
https://github.com/bitcoin/bitcoin/pull/13320/files
https://github.com/bitcoin/bitcoin/pull/13510/files
https://github.com/bitcoin/bitcoin/pull/14831/files
Depends on D3945.