NetBSD-Bugs archive

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

Re: standards/42828: Almquist shell always evaluates the contents of ${ENV} even if non-interactive



The following reply was made to PR standards/42828; it has been noted by GNATS.

From: David Laight <david%l8s.co.uk@localhost>
To: Richard Hansen <rhansen%bbn.com@localhost>
Cc: Robert Elz <kre%munnari.OZ.AU@localhost>, gnats-bugs%NetBSD.org@localhost,
        standards-manager%NetBSD.org@localhost, netbsd-bugs%NetBSD.org@localhost
Subject: Re: standards/42828: Almquist shell always evaluates the contents of 
${ENV} even if non-interactive
Date: Wed, 24 Feb 2010 20:44:36 +0000

 On Wed, Feb 24, 2010 at 12:37:55AM -0500, Richard Hansen wrote:
 > >
 > >No, that doesn't work, built in commands are executed before commands 
 > >found in $PATH, so that doesn't work to override stuff like test, let 
 > >alone the built in commands that can't go in $PATH (like cd) which happens 
 > >to be one of the commands I most often want to override.   That can be 
 > >done by defining a cd() function, and that works in ${ENV}.
 > 
 > Ah ha!  That's what I was looking for.  I can see how overriding 
 > built-ins could be useful, and the POSIX design makes it impossible. 
 > Now I see the benefit of evaluating a file at the start of 
 > non-interactive shells (I just couldn't think of a practical use for the 
 > non-standard behavior).
 
 Actually, for non-special builtins, posix requires that the builtin version
 only be used if the one that would be executed when $PATH is searched
 would be the systems 'standard' version.
 Which would mean that the builtin 'echo' could only be used if the
 shells command hash table contained /usr/bin/echo.
 Netbsd's /bin/sh doesn't behave that way!
 (and I'm not going to change it!)
 
        David
 
 -- 
 David Laight: david%l8s.co.uk@localhost
 


Home | Main Index | Thread Index | Old Index