Date:        Fri, 10 Aug 2018 16:48:29 +0100
    From:        Geoff Clare <g...@opengroup.org>
    Message-ID:  <20180810154829.GA26874@lt2.masqnet>

  |  Wouldn't simply changing
  | "multiple fields" to "multiple fields or no fields" solve it?

There was one more thing I meant to say about that solution,
which I forgot originally, and then again when I last replied to this.

If you do it this way, there is no way to keep (the effect of)
that "may" in "any empty fields may be discarded" in 2.5.2,
as by the time field splitting happens, the fact that an empty
field was generated this way is no longer visible, if field splitting
is going to be tasked with removing empty fields, then all of
them will go (just as in the "shall delete" version of the
paragraph I put in the note, and to which you objected.)

I don't object to that, as I don't think that the "may" is important,
I think fields from empty args (from unquoted $@ or $*) should
be deleted, not included as null strings, and shells that don't do
that ought to simply be regarded as broken.

It might also be worth pointing out though, that 2.5.2 seems to
exempt these particular empty fields from field splitting, though
exactly how that is intended to work I have no idea.   2.6 simply
applies field splitting to "the portions of the fields generated by step 1"
(no exceptions, and nor should there be) and any such empty
fields are exactly that.

Of course that exemption might have been just because field
splitting an empty field cannot possibly change anything (there
cannot be any chars from IFS in it) and so there's no point
trying.   Of course, that was back before field splitting gained the
extra task of cleaning up unwanted empty fields...

kre

Reply via email to