Hi.
In thread Date Format Problem , Aia and I were discussing the usefulness of using #!/usr/bin/env bash
(or ksh, or perl, or ...) as the shebang line. The exchange was good, but it was getting beyond the scope or the thread, so I decided to continue it here.
My preference is in favor of using it, while Aia wrote:
and
My reply to this is that in that same Wikipedia link, we see:
The exceptions noted in that Wikipedia article are:
There are still some portability issues with OpenServer 5.0.6 and Unicos 9.0.2 which have only /bin/env and no /usr/bin/env.
To which I say, if someone is porting to such earlier SCO or Cray OSs (or even to current implementations), they probably will have many more troubles than just the shebang line. Researchers don't usually run just shell scripts on Cray, etc. machines, they run very large, complex codes. The number of people using such machines are far in the minority compared to the other systems I mentioned in an earlier post.
(If it has been noted that I am from Minnesota, one might speculate that I have some connection with Unicos on Cray computers. Indeed I worked at the University of Minnesota and the associated Minnesota Supercomputer Center for about 25 years. We handled really big iron. If memory serves, when I left MSC, we had 3 Crays, an ETA-10, a Thinking Machines CM-2 (32K single-bit processors, ganged together to 1000 processors, SIMD), a TMC CM-5 (MIMD), a pair of 6-CPU IBM 3090s t(ied together through some very large memory accessory), and probably some other gear I have forgotten.
I live now in the suburbs, but even so, I live within walking distance to at least 5 colleagues who worked at Cray or MSC or both, including one who is a co-author of O'Reilly's bash Cookbook, from where I got the env
shebang idea. It is worth noting that in that book one can find:
)
In summary, my conclusion is that #!/usr/bin/env
is a very good solution to the problem of portability among the many environments that I often encounter, but to each their own.
Best wishes ... cheers, drl