Page MenuHomePhabricator

[LINTER] Enforce using `#!/usr/bin/env bash` for shell scripts

Authored by Fabien on Aug 26 2019, 17:21.



Update the shell scripts to always have a shebang and use whether bash:

#!/usr/bin/env bash

or the system shell:


Other forms will throw an arcanist error at lint time.

Backport of core PR13320, PR13510 and PR14831

Depends on D3945.

Test Plan

Edit a shell script to have a bas shebang then run:

arc lint

Ensure the linter catches the error.

Should return no error (requires D3946 to have zero output):

arc lint --everything

Diff Detail

rABC Bitcoin ABC
Automatic diff as part of commit; lint not applicable.
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

Fabien created this revision.Aug 26 2019, 17:21
Herald added a reviewer: Restricted Project. · View Herald TranscriptAug 26 2019, 17:21
deadalnix accepted this revision.Aug 27 2019, 13:22
This revision is now accepted and ready to land.Aug 27 2019, 13:22
Fabien updated this revision to Diff 11016.Aug 29 2019, 06:20

Rebase for arcanist cache.
Use a separated set -e instead of adding it to the shebang to make shellckeck happy.