2 ms·
env hasn't always been in /usr/bin. I've worked on systems (probably SunOS 4.something) that had /bin/env but not /usr/bin/env. But you're unlikely to run into
by _kst_ 7y ago
env hasn't always been in /usr/bin. I've worked on systems (probably SunOS 4.something) that had /bin/env but not /usr/bin/env. But you're unlikely to run into any reasonably modern Unix-like system that doesn't have /usr/bin/env .
See also my Stack Exchange answer on the advantages and disadvantages of the "#!/usr/bin/env ..." convention:
https://unix.stackexchange.com/a/29620/10454 https://unix.stackexchange.com/a/29620/10454
Quick summary:
The advantage of "#!/usr/bin/env INTERP" is that it will use the first INTERP in the user's $PATH.
The disadvantage is that it will use the first INTERP in the user's $PATH.