-
Notifications
You must be signed in to change notification settings - Fork 6.2k
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
Make bash scripts more portable #347
Make bash scripts more portable #347
Conversation
Can you provide a source for this? As far as I know, POSIX does not define the location of any program. It's available there on most systems, though. |
Ah! You're right. It was Freedesktop I was thinking of, and it isn't so much that they defined a set path for My apologies. That said, though I can't find something to point to that says "env is always installed at /usr/bin/env", I can say I've never seen it installed anywhere else, and this form of calling out to env for shebangs in scripts is so widely adopted that it feels like an unofficial standard at the very least. :) |
For what it's worth, at least SunOS 5.10+ also has |
To my knowledge the only OS that has ‘env’ in a different location is GuixSD. |
That's of course true, citing SunOS 5.10 again, /bin/sh is not a POSIX-compliant shell but the bourne-shell, just as /bin/ksh is the korn-shell, /bin/csh the c-shell etc., just as God intended ;) But I think |
Not every OS installs bash at /bin/bash. OpenBSD for instance installs bash at /usr/local/bin/bash. /usr/bin/env's location is defined by POSIX, so this will Always Work(R).
This makes ghidra run out-of-the-box on OpenBSD :)