Ravi Sir's Cards › AWS
indexed vs associative
This comparison card contrasts indexed and associative. indexed is described as numbered 0, 1, 2. associative is described as named keys. The card pairs indexed with ordered lists, and associative with lookups and counters.
Read card text
What this card says
Array
indexed
Numbered 0, 1, 2.
associative
Named keys.
Key points
No declare needed.
Needs declare -A.
Example
a=(x y z)
Use when
Ordered lists.
Lookups and counters.