Replace hardcoded shebangs with /usr/bin/env for portability#1105
Merged
devacts merged 1 commit intocarvel-dev:developfrom Feb 16, 2026
Merged
Replace hardcoded shebangs with /usr/bin/env for portability#1105devacts merged 1 commit intocarvel-dev:developfrom
devacts merged 1 commit intocarvel-dev:developfrom
Conversation
Changes all scripts to use #!/usr/bin/env bash/sh instead of hardcoded paths like #!/bin/bash and #!/bin/sh. This improves portability across different systems (NixOS, BSD, etc.) where interpreters may not be in standard locations.
CodesbyUnnati
approved these changes
Feb 16, 2026
Member
CodesbyUnnati
left a comment
There was a problem hiding this comment.
LGTM, Thanks for raising this PR.
devacts
approved these changes
Feb 16, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this PR does / why we need it:
Replaces hardcoded shebang paths (
#!/bin/bashand#!/bin/sh) with portable versions (#!/usr/bin/env bashand#!/usr/bin/env sh) in all shell scripts in thehack/directory.This improves portability across different Unix-like systems where shell interpreters may not be in standard locations, such as:
/run/current-system/sw/bin/bash/usr/local/bin/bashUsing
/usr/bin/envis the POSIX-recommended approach and is already widely adopted in the Go ecosystem.Which issue(s) this PR fixes:
Fixes #1104
Does this PR introduce a user-facing change?
Additional Notes for your reviewer:
This is a straightforward portability fix that doesn't change any functionality. All 10 shell scripts in the
hack/directory have been updated. The scripts will continue to work exactly as before on systems with bash in/bin/bash, while now also working on systems where bash is in other locations.Review Checklist:
a link to that PR (N/A - no doc changes needed)
change
Additional documentation e.g., Proposal, usage docs, etc.: