-
-
声明Map
- declare -A testMap
-
-
赋值
- testMap[“one”]=“001”
- testMap[“two”]=“002”
- testMap[“three”]=“003”
-
-
输出
- 输出值 ${testMap[“two”]}
- 输出key ${!testMap[@]}
- 输出value ${testMap[@]}
- 遍历
for key in ${!testMap[*]};
do
echo $key
echo ${testMap[$key]}
done