Simple example of array variables

#!/bin/ksh
ary_ndx=1
ary_val[$ary_ndx]="First"
ary_ndx=2
ary_val[$ary_ndx]="Second"
 
a=0
while [ $a -le $ary_ndx ]
do
   echo ${ary_val[$a]}
   a=`expr $a + 1`
   echo $a
done

Author: Dean Capps

Database consultant at Amazon Web Services.