On 9/3/23 6:08 AM, Dan Jacobson wrote:
It's not fair:
set -x a b c
m=$@ n=($@)
== gives ==
+ m='a b c'
+ n=($@)

It's because the compound assignment forces the expansion to be deferred.
You have to figure out what kind of array you're dealing with, for example,
and what kind of compound assignment, and bash figures all that out after
the `we're performing a variable assignment with xtrace enabled, print the
rhs' code runs.

--
``The lyf so short, the craft so long to lerne.'' - Chaucer
                ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU    c...@case.edu    http://tiswww.cwru.edu/~chet/


Reply via email to