here is a sample code
astr[10]=a
astr[20]=b
astr[30]=b
astrR="astr[@]"
echo ${!astr[@]} #the indexes
echo ${!astrR} #the values
#FAIL: echo ${!!astrR}
astrR="!astr[@]" # wild guess
echo ${!astrR} # empty output, so I am still wild
So, how to get the indexes using astrR
?
astrR
? Are you trying to print indices and values of the associative array? – Inian Jan 21 '19 at 16:56bash
is not supported directly. You might need to re-consider your design if you are planning to do this bash – Inian Jan 22 '19 at 02:56declare -n strR="astr"
, may be I should just delete this? – Aquarius Power Jan 22 '19 at 16:02