I have this little piece of code:
#!/bin/bash
item01=('item1' '1' '20')
item02=('item2' '4' '77')
item03=('item3' '17' '15')
zeroone=01
zerotwo=02
echo ""
declare -a array=()
array=${item$zeroone[@]}
echo ""
echo ${array[@]}
echo ""
Obviously this doesn't work (bad substitution).
Is there a way to make it work? Such that a variable can be a part of an array name?
And also, to make this work in particular:
array[0]=${item$zeroone[0]}
and
another_variable=${item$zeroone[0]}
Thx