On Jul 27, 2020, at 1:31 AM, Dale R. Worley <worley@alum.mit.edu>
wrote:
Interesting. The documentation for 4.2.53(1) says this about
parameter
assignments generally, with no special rules for compound assignments:
All
values undergo tilde expansion, parameter and variable
expansion, com-
mand substitution, arithmetic expansion, and quote removal (see
EXPAN-
SION below). ... Word splitting is not
performed, with the exception of "$@" as explained below under
Special
Parameters. Pathname expansion is not performed.
So it seems like the word splitting in "A=(X$Z)" is incorrect. So is
pathname expansion in that context.
If word splitting were not performed in compound assignments, this...
foo=(a b c)
...would not work. If pathname expansion were not performed in compound
assignments, this...
foo=(*)
...would not work. Arrays would become significantly less usable if
word splitting and pathname expansion were not allowed in compound
assignments.