bug-coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: env (GNU coreutils) 5.93 patch


From: Bob Proulx
Subject: Re: env (GNU coreutils) 5.93 patch
Date: Tue, 3 Jan 2006 09:07:12 -0700
User-agent: Mutt/1.5.9i

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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]