nick34992
2/20/2017 - 7:04 PM

Bash: array, echo: Display Index List Using Array

Bash: array, echo: Display Index List Using Array

#!/bin/bash

array_i=(1 2 3 4 5)
array_i[0]='index1'
array_i[1]='index2'
array_i[2]='index3'
array_i[3]='index4'
array_i[4]='index5'
echo 'number of items:' ${#array_i[*]}
echo ${array_i[*]}