Subject: Re: ${ENV} vs. ${SETENV}
To: J Chapman Flack <flack@cs.purdue.edu>
From: Hubert Feyrer <hubert@feyrer.de>
List: tech-pkg
Date: 04/08/2005 20:29:21
On Fri, 8 Apr 2005, J Chapman Flack wrote:
> I'm still wondering just why SETENV is set to anything at all.  Why do we
> say   env FOO=BAR command args    when   FOO=BAR command args    does the
> same thing, without an extra exec()?
>
> Even the Rationale section for env(1) in SUSv3 acknowledges that the only
> new functionality provided by env is (a) to print the environment, and
> (b) to *replace* the environment (clean slate, -i), neither of which is what
> ${SETENV} gets used for in pkgsrc.  I assume there's a perfectly clear
> explanation why it's used that way in pkgsrc, and it just hasn't hit me; can
> someone explain?

My guess:

Because in some shells the two are not alike:

 	% foo=bar date
 	foo=bar: Command not found.

while with env(1) the behaviour is the same everywhere.

I have no idea if a Bourne(compatible) shell is used/enforced/set for all 
pkgs in pkgsrc or make. I don't even know how to force this or what the 
exact default is.


  - Hubert

-- 
NetBSD - Free AND Open!      (And of course secure, portable, yadda yadda)