Chet Ramey wrote, on 11 Apr 2025: > > The question is whether shells will agree on *which* empty fields are > discarded. [...] > For everyone who isn't on the bash mailing list, this is the message > from kre that Steffen is referring to that explains the bash and NetBSD > sh behavior. > > https://lists.gnu.org/archive/html/bug-bash/2025-03/msg00030.html
Okay, with Chet's clue and kre's detailed description, I now see that my expectation of "empty fields may be discarded" leading to exactly two conforming behaviours was wrong. I had naïvely assumed that each shell would either discard all empty fields or retain all empty fields. According to kre, bash only discards one trailing empty field and retains all others, and mksh discards leading and trailing empty fields but retains intermediate ones. These subtleties can easily account for the four different behaviours of ksh88, ksh93/dash, bash, and mksh. So I'm now of the opinion that no change is needed to the normative text, but it might be worth adding some informative text pointing out that "empty fields may be discarded" doesn't mean that shells can only either discard all empty fields or retain all empty fields. -- Geoff Clare <g.cl...@opengroup.org> The Open Group, Apex Plaza, Forbury Road, Reading, RG1 1AX, England