#!/bin/bash
names[1]=3
names[2]=5
names[3]=15
for i in {1..3}; do echo ${names[$i]}; done;

echo "____________"

sleep 1  

#add new element (dynamic array)
names[12]=50 
#print array 
for i in {1..12}; do echo ${names[$i]}; done;

echo "____________"

sleep 1

#Note: to avoid blanks use: 
for i in ${names[@]}; do echo $i; done;
#to delete the (dynamic) array 
unset names 
