Adapted to run as an Arcanist linter, and added fixes for the scripts
which are Bitcoin ABC only.
Because the quantity of shell script is limited, the performance cost is
almost unnoticeable.
Backport of core PR12871
https://github.com/bitcoin/bitcoin/pull/12871/files