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 Fri, Mar 01, 2013 at 04:45:19AM +0700, Robert Elz wrote:
> 
>   | The problem is that the specification allows both interpretations,
>   | because there is no definition of "utility"
> 
> There is, see 4.20  (it is basically something implemented outside the
> shell, it can be an executable, or a script, but not a built-in or function)

No: the paragraph says "The system may implement certain utilities as
shell functions (...) or built-in utilities", that is the word is
ambiguous and the specification conflicts (with your interpretation)
since there is a difference of behavior between an external utility and
the same implemented as a function. Except if this mandates a shell to
treat a function differently if this may be an external utility. But in
this case the list must be fixed that is the utility would have to
be in the POSIX.2 utilities list... And this will be, IMO, crazy.

And once more, from your initial example:

var=value fn

I fail to see the need for such thing (with the consequences) when this
is typically used to modify the environment in the scope of an utility,
and this can be made persistent (or actual before the function is called
and the substitution) by making a separate assignement (with the newline
of semi-colon end).

The discussion has brought some _other_ points (that I was not aware
of) so it is not useless. But for this very case...
-- 
        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