With myarray that containsIf I have an array with 5 elements, I can usefor example:
[a][b][c][d][e]
Using echo ${myarray[4]} to access the last itemI can see what it holds.
What can I do whenBut what if I don'tdidn't know the number of array elements in a given array? Is there a way of reading the last element of an unknown length array? i.e. The first element reading from the right to the left for any array?
I would like to know how to do this with Bashin bash.