Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: [BUG] var=$* and var=$@ create array with SHWORDSPLIT and null or unset IFS

Op 20-02-17 om 22:20 schreef Bart Schaefer:
> Thanks to Chet Ramey for pointing me at
> http://austingroupbugs.net/view.php?id=888
> Which says (very last block of examples) that var=$@ and var="$@" and
> a whole slew of their variations, have unspecified behavior.

True. I should not have included that in the test case.

It makes sense for var=$@ and var="$@" to be unspecified. In a pure
POSIX context these does not make sense, because POSIX does not have
arrays, and we've already got $* to combine the PPs into a scalar. But
for zsh or bash, which do have arrays, it could actually make sense to
make var=$@ and var="$@" properly equivalent to var=("$@"). It's just
that no shell currently does this, at least not intentionally; zsh's
current behaviour as reported was clearly not consistent.

> Consequently I'm going to take the position that zsh is allowed to join
> these with empty string rather than pulling a field separator out of
> its proverbial hat, and I will tweak 40565 appropriately and commit.


- M.

Messages sorted by: Reverse Date, Date, Thread, Author