|
|
|
|
|
by etanol
5029 days ago
|
|
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
|
|
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?)