3 ms·
Curious for what systems this does not work? I start a lot of my shebangs with `#!/usr/bin/env <app>` such that I can rely on PATH for resolving application loc
by flakes 3y ago
Curious for what systems this does not work? I start a lot of my shebangs with `#!/usr/bin/env <app>` such that I can rely on PATH for resolving application locations.
- chuckadams 3y agoJust plain #!app also works. Probably less portable, but it does work on linux and macOS. Not sure if POSIX has anything to say about shebangs.
- flakes 3y agoHuh, I guess I've never given it too much thought. I was under the impression for some reason that the first argument was supposed to be an absolute path.
- chuckadams 3y agoIt might have had to be absolute on ancient Unixen ... Unices? Seems POSIX has all of this to say about shebangs: If the first line of a file of shell commands starts with the characters "#!", the results are unspecified. So it's basically all down to convention, but one that's been followed long enough that you can rely on it. I still don't count on shebang taking more than one argument to the command though.