Author: Harald Arnesen Date: To: dng Subject: Re: [DNG] Danger: Debian POSIX hostility
Rick Moen [22.09.2020 20:11]:
>> I worry about a different kind of portability. If I ever have to switch
>> to BSD (and this remains a possibility, unfortunately), /bin/* shebangs
>> will not work except for /bin/sh, and /bin/sh is always ash. That is
>> because on BSD everything not in the core system goes into /usr/local.
> You know, if going for maximum portability, you can rely, within the
> shebang, on /usr/bin/env. Like:
>
> #!/usr/bin/env bash
>
> Although there's no absolute guarantee that env(1) will reside in
> /usr/bin on all Unix machines ever made, it does live there on BSDs.
> And I'm willing to bet that it's going to exist and be in /usr/bin on
> Unixes made written the last quarter-century.
And if you have to use a Unix system without env in /usr/bin, you can
always symlink or copy it there. Provided you have root access, of course.
--
Hilsen Harald