-
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
fix: changed shebang to make scripts more platform independent #2893
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
Conversation
See for example this thread: https://stackoverflow.com/questions/21612980/why-is-usr-bin-env-bash-superior-to-bin-bash on why its better to use '#!/usr/bin/env bash' instead. Without this change these scripts will not run on some platforms. This is not a breaking change for the platforms it already works on.
Out of curiosity, under what systems does it not work? I am aware of this practice but I'd like to learn when this becomes an issue in practice for |
Good question! On NixOS (my system) direct paths are almost always a problem. For example for me, bash located at:
Which is a symlink to:
But it seems to also be an issue particularly on non-Linux systems. For example, on OpenBSD systems it's usually in |
Should this change also be applied to e.g. |
No but good catch, this is cause that’s using |
I'm now mildly curious about the differences in the script that caused one to end up with sh and the other with bash. The nitpicky part of me wants them all to be consistent. That's not something that should be considered at all for this PR, though. |
Haha no I get it. It feels cleaner if they’re all the same... As for why, I think that’s cause people just use bash, so they put |
There are a few bashisms used in the bash scripts, usually you need a bit more diligence when writing POSIX sh. In my experience, it isn't too hard to make them POSIX compatible but replacing some bash features like arrays can be quite annoying. |
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.
Thanks!
See for example this thread on why its better to use
#!/usr/bin/env bash
instead of#!/bin/bash
. Without this change these scripts will not run on some platforms. This is not a breaking change for the platforms it already currently works on.PR check-list