[PATCH v3] scripts: make bash scripts more cross-platform#2244
Open
christomel wants to merge 1 commit intoOpenDataPlane:masterfrom
Open
[PATCH v3] scripts: make bash scripts more cross-platform#2244christomel wants to merge 1 commit intoOpenDataPlane:masterfrom
christomel wants to merge 1 commit intoOpenDataPlane:masterfrom
Conversation
Collaborator
|
Seems like a good improvement, thanks! Please fix the commit author to make checkpatch happy and add my reviewed-by tag: Also, I'll send you a contributor agreement, which has to be signed before we can merge this PR. |
Before this change scripts wrongly assume that `bash` resides at `/bin/bash`. This is not always the case and in fact is not mandated by POSIX. One example of a UNIX OS which does not have bash in `/bin/bash` is NixOS. A workaround for this is to use `/usr/bin/env bash`, which is a standard way to get bash from user environment and works on a wider range of systems than `/bin/bash` Therefore, this change replaces every `/bin/bash` with `/usr/bin/env bash`. Wherever `/bin/bash` took extra arguments, those arguments were moved out of line, because `env` interprets arguments as part of a program name Signed-off-by: christomel <218936083+christomel@users.noreply.github.com> Reviewed-by: Matias Elo <matias.elo@nokia.com>
aab62f9 to
09e3eb4
Compare
Collaborator
|
A small mixup. The signed-off-by tag ( |
Collaborator
|
Ping @christomel |
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.
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