Paul Eggert wrote: > Bob Proulx writes: > > On what systems is env located in /bin/env? The normal location is in > > /usr/bin/env. > > POSIX doesn't specify the location for env, so either location conforms > to POSIX. On Solaris 10, the standard location is /usr/xpg4/bin/env. > (/usr/bin/env doesn't conform to POSIX, I guess....)
I have a hard time imagining in what way /usr/bin/env would not conform to POSIX. (But not enough to ask anyone to look. I am just commenting in passing.) It seems like one such a simple command. Oh well. > > This is counted upon by many scripts using /usr/bin/env as a > > launcher. > > That works on most systems, but it's not portable according to POSIX. > > The "right" way to fix this is to substitute the absolute path name > into the shell script, I'm afraid. There are levels of portability. It is always a judgement call to trade off portability versus readability and maintainability. This one is not particularly bad. But it is a pain when the installation is always unique. If you can require that the system be modified without any issue (I can in a number of applications) then I think '#!/usr/bin/env' is fine. Because any system that does not have /usr/bin/env will run into a number problems in the future with other scripts and installing env there (or a symlink) will fix the compatibility issue at the system level. Often fixing the compatibility issue at the system level is much simpler than trying to work around it at the application level. Bob _______________________________________________ Bug-coreutils mailing list [email protected] http://lists.gnu.org/mailman/listinfo/bug-coreutils
