Chet Ramey wrote in <[email protected]>: |On 4/11/25 3:37 PM, Steffen Nurpmeso wrote: |> Chet Ramey wrote in |> <[email protected]>: |>|On 4/11/25 3:47 AM, Steffen Nurpmeso via austin-group-l at The Open Group |>|wrote: |>|>|So I think the question for the shell authors is can they reach a |>|>|consensus on which two behaviors are "right" (by which I mean they meet |>|>|user expectations, not that they behave as currently described in the |>|>|standard), or do they think more than two of the observed behaviors are |>|> |>|> Well, only to add that bash, NetBSD k?sh and possibly more behave |>|> exactly "as currently described in the standard", except for, as |>|> you say, the special parameter $*, they use "the quoted variant of |>|> $*" as a source for field splitting, instead of generating "one |>|> field for each positional parameter that is set", and splitting |>|> the result of that. |>| |>|That doesn't matter; the implementation doesn't matter. All that matters |>|is that the result conforms to the standard, and the bash output does |>|("any empty fields may be discarded"). |> |> I am sorry that you alway react stroppingly if i come over with |> something, unless you are right or can give advice. | |I'm sorry it came across that way. That was meant to be a plain factual |statement.
Sure, forget it. |> The above is plain not true, and it took me months to finally |> believe that it is not my code that is broken, but that the |> standard is not in line with what is actually happening. | |What about the above quoted text from the standard does not reflect Yes. ..And hoping the issue solves it. |what is happening? I think kre's stepwise explanation was pretty good. It actually boils down to Both bash and the netbsd shell retain leading empty words from $* expansions, that, then. |> And never was, as Geoff Clare has shown when trying against ksh88. | |It would not be the first time that the standard as written did not |reflect the behavior of the reference implementations (or any |implementations, for that matter). I seem to recall Geoff Clare's "unfortunately not". |>|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 |> |> No. That is not the message. | |It is the message that explains how bash (and the NetBSD sh) arrive at the |results they do, and why those results are consistent with the standard |text. It is by no means the only message in the thread. :-) To recall it boils down to Both bash and the netbsd shell retain leading empty words from $* expansions, |> But i looked, and it more is |> |> https://lists.gnu.org/archive/html/bug-bash/2025-03/msg00041.html | |I'll let kre speak for himself if he wants to repost his responses. They're |there in the bug-bash thread. If that is what they do. I never looked. I would have to think and find an example where the approach that works for me (simply taking the quoted variant of $*) will create a different result; i am a bit out of desire to find more complicated ones ... and i now have quite some (mostly bash-only) disproofer scripts. (It would be complicated to implement "retain leading empty words" here.) A nice weekend i wish, --steffen | |Der Kragenbaer, The moon bear, |der holt sich munter he cheerfully and one by one |einen nach dem anderen runter wa.ks himself off |(By Robert Gernhardt)
