[PATCH v3] scripts: make bash scripts more cross-platform #2244
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.
Before this change scripts wrongly assume that
bashresides at/bin/bash. This is not always the case and in fact is not mandated by POSIX. One example of a unix which does not have bash in/bin/bashis NixOS.A workaround for this is to use
/usr/bin/env bash, which is the standard way to get bash from user environment and works on a wider range of systems than/bin/bashTherefore, this change replaces every
/bin/bashwith/usr/bin/env bash. Wherever/bin/bashtook extra arguments, those arguments were moved out of line, becauseenvinterprets arguments as part of a program name.Solves #2243