1
有没有办法列出bash关联数组变量上的所有“索引ID”(键)?
我有这个数组: declare -A astr 我向其中添加元素: astr[elemA]=123 astr[elemB]=199 但是稍后,我需要知道什么是索引ID(elemA和elemB)并列出它们。 echo "${astr[@]}" #this only get me the values...
与其他Bourne / POSIX shell相对,GNU的Bourne Again SHell特有的问题。对于一般关于Unix shell的问题,请改用/ shell标记。