On 2020-12-15 16:58, Chet Ramey wrote:
> On 12/15/20 11:23 AM, Glenn Jackman wrote:
> > I would think that these pairs of invocations would correspond:
> > 
> >      declare -A v1=$( $foo 3 )
> >      declare -A v1=$( [1]=2 [3]="")
> > 
> >      declare -A v1=$( "$foo" 3 )
> >      declare -A v1=$( ['1 2']=3 )
> > 
> > Do word splitting and quote removal not occur within the parentheses of an
> > _associative_ array definition?
> 
> Associative array keys do not undergo word splitting on assignment, whether
> they are used in a subscript or the alternate key-value synatx. This has
> been the case since their introduction in bash-4.0.

Ah, that's the bit I was missing. Thank you for taking the time to
clarify. I don't see that documented in the manual though. Where did I
miss it?

-- 
Glenn Jackman
    Write a wise saying and your name will live forever. -- Anonymous

Reply via email to