News for hackers. Stuff that matters.
Re:Using /usr/local by etanol on Wednesday September 12, 2012 @04:33AM (#4509708)
While I agree about the use of /usr/bin/env, you should be aware that some systems will perform only one word split on the shebang line. That means that if you use env, you can't pass any options to the $executable.

You can try it if you want, save this into an executable file (test.awk):

    #!/usr/bin/env awk -f
    { print $2 }
Then run:

    echo "Hello world again" | ./test.awk
I get the following:

    /usr/bin/env: awk -f: No such file or directory
Re:Using /usr/local by masklinn on Wednesday September 12, 2012 @05:00AM (#4509796)
> I get the following:

Damn. I get "world" (OSX, zsh, BSD env)

So I supposed you can't pass options to `env` either (e.g. `-i`, or ENVVAR overrides?)

Re:Using /usr/local by etanol on Wednesday September 12, 2012 @05:27AM (#4509857)
This is a kernel issue, it has nothing to do with userspace tools. For example, the Linux code responsible for parsing shebangs is here:

http://git.kernel.org/?p=linux/kernel/git/stable/linux-stabl...

Re:Using /usr/local by masklinn on Wednesday September 12, 2012 @07:13AM (#4510103)
Interesting, thanks for the info. I wouldn't have thought it so low in the architecture.