Say I've got the following array:
items[0]=0
items[1]=1
items[2]=2
etc.
Using echo/printf, how would I output only specific cells, for instance only cells 0,2,4. So far I've got this:
echo "${items[*]}"
This outputs all of the array, but how would I alter this line to make it only output the specified cells? I'm pretty sure I'm just missing what the syntax for this is.
Edit: Sorry, I inaccurately described what I'm asking. What I need to find out, is how to output the specified data point by calling the array only once.
For instance:
echo ${items[magical code stuff here]magical code stuff here too maybe}"