5 lines
263 B
Bash
5 lines
263 B
Bash
x=${#alist[*]} # start with the number of items in the array
|
|
while [[ $x > 0 ]]; do # while there are items left
|
|
: $((x--)) # decrement first, because indexing is zero-based
|
|
echo "Item $x = ${alist[$x]}" # show the current item
|
|
done
|