Op 21-03-17 om 10:42 schreef Geoff Clare:
> Martijn Dekker <mart...@inlv.org> wrote, on 18 Mar 2017:
>> 1. This is irrelevant, because the bug does not concern splitting
>> fields, but instead failure to generate fields as specified.
>>
>> 2. Even if it were relevant, in the case under discussion, IFS is null,
>> so field splitting is a no-op anyway.
>>
>> 3. In the general case, field splitting not being listed there simply
>> means that field splitting is not performed for the word on the right
>> side /within/ an expansion such as ${var-$*} (in this case, that word
>> being $*). If neither the ${var-$*} expansion as a whole nor the /word/
>> within the expansion (in this case, $*) are quoted, then field splitting
>> is performed as normal for the expansion as a whole (as is pathname
>> expansion/globbing), as detailed in 2.6.
> 
> Points 1 and 2 are wrong, but 3 is right and that's the one that matters.
> 
> (The reason 1 and 2 are wrong is because of the part of the $* description
> you omitted above: "When the expansion occurs in a context where field
> splitting will not be performed, the initial fields shall be joined to
> form a single field ...")

Sorry to be awkward, but this makes no sense to me and I'd like to
understand the intention of the standard.

Since the expansion is unquoted in this example, how are we in a
"context where field splitting will not be performed"? Aren't we
lexically in a field splitting context, but field splitting happens to
be a no-op because IFS is null?

What am I missing? Am I perhaps misinterpreting the word "context" and
it means some other kind of context than lexical context?

Actually, if I'm wrong in 1 and 2 and you are right, then doesn't the
standard say that "the initial fields shall be joined to form a single
field", so then isn't my whole bug report wrong and the original example
correct?

(But if that's the case, no existing shells would be compliant... not
even bash, which would only be compliant for unquoted ${var-$*}, ${1+$*}
etc. and not for simple unquoted $*.)

> Please could you submit a new Mantis bug to request the change to the
> example output.

Done.

- M.

Reply via email to