Section: Associative Arrays

Read associative array item

bash
bash
echo "${ports[https]}"
Explanation

Associative arrays are ideal for lightweight maps.

Learn the surrounding workflow

Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.

Related commands

Same sheet · prioritizing Associative Arrays
Create associative array
Declare an associative array.
OpenIn sheetbashsame section
Loop through key/value pairs
Iterate through an associative array.
OpenIn sheetbashsame section
List associative array keys
Expand associative array keys.
OpenIn sheetbashsame section
Create indexed array
Create an indexed array.
OpenIn sheetbash1 tag match
Access array element
Read an array element by index.
OpenIn sheetbash1 tag match
Expand all array items
Expand all array items safely.
OpenIn sheetbash1 tag match