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



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