tech-userlevel archive

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

Re: bin/47597: local and $() don't play well with each other



On Tue, Feb 26, 2013 at 07:34:11PM +0700, Robert Elz wrote:
>[...] 
> But yes, my point was not that NetBSD fails (it doesn't, though did some
> time in the ancient past) but that it does not act the same as the SUS
> says it should (which is how ksh on NetBSD behaves).
> 
> The question was whether I could rely upon NetBSD's sh not being "fixed"
> to act like the (absurd) ksh/SUS does?

Well, I'm not a "SUS expert", but I fail to see in which way NetBSD sh
differs from SUS specification. From your quotes (and the SUSv3 spec I
have), what SUS enforces is a "shall not": a not special-builtin shall
not make an assignment made during its call a persistent one.

2.14:

        Variable assignments specified with special built-in
        utilities remain in effect after the built-in completes;
        this shall not be the case with a regular built-in or other
        utility.

echo in NetBSD sh is a builtin but is _not_ a special-builtin (the list
is specified by SUSv3). I guess that ksh makes permanent assignments for
all builtins and not _only_ the special ones. 

So, from _my_ lecture, NetBSD sh is compliant, while ksh from your test
is not. 
-- 
        Thierry Laronde <tlaronde +AT+ polynum +dot+ com>
                      http://www.kergis.com/
Key fingerprint = 0FF7 E906 FBAF FE95 FD89  250D 52B1 AE95 6006 F40C


Home | Main Index | Thread Index | Old Index