-
-
Notifications
You must be signed in to change notification settings - Fork 109
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix shebangs to #!/usr/bin/env bash
in all .sh files
#535
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe this is an improvement, maybe not.
I would be in favor of using env
for this purpose. We had already similar issues in ASTE. Problem: on compute clusters, the hardcoded path might not lead to the version you actually want to use. Here, env
takes care of this.
The only change I am not sure about is that you changed the requirement from a POSIX shell to bash. Why not using #!/urs/bin/env sh
instead?
I thought of this while first creating all these scripts (or at least when making them consistent, in their current version), but I don't remember why I decided to keep the hard-coded path. If this has already triggered issues, then let's indeed change it. The version argument is a valid one, apparently not only for clusters, but also for macOS. However, I agree with @davidscn: I chose |
edc68b8
to
96bfbd5
Compare
Okay, so this time it's using |
But interesting: Look at the failing pipeline! |
@@ -1,4 +1,4 @@ | |||
#!/bin/bash | |||
#!/usr/bin/env sh |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To be more concise with my previous comment: the way we call the shell should not alter the shell environment. Not all scripts are POSIX compatible.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree with David: it is intentional that most scripts are sh
but a few are bash
. In any case, the kind of shell is not something we should change here.
Okay, I've split the commit in two parts. Now I got what you meant @davidscn :D Commands I used for reference: |
Thanks! |
This allows all scripts to be run without hardcoding
/bin/bash
as an interpreter.Maybe this is an improvement, maybe not.
Someone should take a look at https://unix.stackexchange.com/a/29620 and document a decision for/against
/bin/(ba)sh
vs/usr/bin/env bash
Checklist:
changelog-entries/<PRnumber>.md
. -> will probably not affect many users (at least not any users using debian/ubuntu)