4 ms·
/usr/bin/env is not in the $PATH I don't think you mean this. When you specify an absolute name, $PATH is not even in the picture. (I do know that some syste
by jrockway 17y ago
/usr/bin/env is not in the $PATH
I don't think you mean this. When you specify an absolute name, $PATH is not even in the picture. (I do know that some systems put env in /bin. Those systems are misconfigured.)
Anyway, shebangs are flaky by design. I just run the correct interpreter directly, as in "/path/to/perl -Ilib bin/script.pl". There is no confusion that way.
- nailer 17y agoYou're right - I think what he means is that env is not in /usr/bin. This was the case on very old (Red Hat Linux 5.2 back in the late 90s) systems where there was no /usr/bin/env -> /bin/env symlink.
- LogicHoleFlaw 17y agoI was bit confused in my description here, sorry. /usr/bin/env existed but when it was run under the cron user's environment it could not locate the interpreter we required and failed silently. The shebang line worked fine under all other users' accounts. Very frustrating. I assume this problem was due to the cron account's $PATH being set up differently somehow. In any case we just went back to explicitly choosing our site-specific interpreter path. Related pet peeve: people using #!/bin/sh when they really want #!/bin/bash. They are not interchangeable!