-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Use /usr/bin/env in shebang. #6
Conversation
On some distributions (e.g., NixOS) the bash binary is not in /bin/bash and the perl binary not in /usr/bin/perl. Using /usr/bin/env in the shebag instead should make it work.
Thanks; I developed these tools as possible inclusions under /tools in the Linux kernel. There are many existing shell and Perl programs already in that directory, however, none of them use env. Eg:
Do you know why? I don't know, but here's some guesses:
Again, I don't know, but I'm trying to understand why none of the existing Linux /tools shell and Perl programs use env. Should they all switch to env? |
Using env for bash script almost never makes sense as you rarely have custom bash version under your $PATH that you want to use. It IS useful if you are running Perl/Python/Ruby script, as those are often used with tools (like perl brew or ruby RVM) that compile your own version of interpreter for various reasons(mostly being independent of distro version, or testing with same interpreter version that is running on production). Those tools usually just complile under some $HOME/directory and then add it to the $PATH TBH i would report it as a bug in distro. If some silly distro developer wants to put their standard binaries in weird locations so be it but distro should provide standard locations via a symlink or sth |
I don't know either. But I'm assuming the reason is simply that almost all GNU/Linux distributions ship The use (or abuse) of Not having a I can understand if your concerns outweigh the support for NixOS. |
@brendangregg I doubt there's any real reason for not using env and it's just kernel developers being lazy. 😉 |
We went through env adoption in BCC and then had to roll back due to issues (now the github history for every BCC tool shows this rollback, which gets annoying when you see it for the umteenth time.) I know it solves some problems, but it creates them as well. Closing. |
On some distributions (e.g., NixOS) the bash binary is not in /bin/bash
and the perl binary not in /usr/bin/perl. Using /usr/bin/env in the
shebag instead should make it work.