Date:        Sat, 15 Mar 2025 23:59:24 +0100
    From:        Steffen Nurpmeso <stef...@sdaoden.eu>
    Message-ID:  <20250315225924.1YC4dm9D@steffen%sdaoden.eu>

  |  |And further, i have zero idea how shells come to the result that
  |  |they do if they do *not* split the fields individually.  But if
  |  |they do, how comes that additional field.

I could explain, as the NetBSD shell does the same thing as bash here,
but I don't really think there's much point.

  | And even further, if that is not what is happening in any of the
  | shells starting with ksh, then the standard wording is deficient
  | and cannot be used by shell implementors to create identical
  | behaviour to already (long) existing shells.
  | What am i missing?

The standard says that any empty fields resulting from an unquoted $*
expansion may be deleted (same with unquoted $@).   Existing shells
do different things (which is why the standard says that).   Hence,
it is impossible to create identical behaviour with existing shells,
as they're not all the same - which is also why users should avoid
doing anything which might provoke those differences (which includes
using unquoted $* or $@ unless you're certain no empty fields exist).

I wouldn't go as far as greg and say never use it, I sometimes use eval
with such a thing, but only when I know that the positional params all
have properly quoted values (which the eval is being used to remove) and
so can never be empty (when the $* is expanded, after eval has done its
thing and the quotes are gone, there may be empty words, but not
resulting, then, from any expansions, so nothing will delete those).

kre


Reply via email to