[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
Robert Elz <kre%munnari.oz.au@localhost> wrote:
> And then (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.
> That is, in the example above, according to the SUS, after the
> foo=xxx f
> the result of "echo $foo" (or just 'f' with no leading assignment)
> should be xxx, but with NetBSD it is bar.
> As the SUS definition of the way this is supposed to work is (IMO) nonsense,
> I simply gave up on var assignments with functions as being a bad joke,
> and (kind of) found another way.
> The point of this message (well, the two points I guess) are to ask if the
> sh & SUS experts on this list agree with my interpretation of what is
> supposed to happen, and what actually happens,
I don't have time to read the standard properly at the moment, but as
a quick remark: is that passage in SUS about
foo=xxx f # (1)
or is it about
export var=value # (2)
I can see how "Variable assignments specified WITH special built-in
utilities" (emphasis mine) can be read both ways, I guess - though I
would say reading (1) is too much of a stretch for prose one would use
in a standard.
Main Index |
Thread Index |