Shell中Map用法
作者:互联网
-
- 声明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
标签:Map,Shell,输出,testMap,two,用法,key,echo 来源: https://blog.csdn.net/zengxingyuluo/article/details/101065479