fix script to work with arrays using bash instead of sh

Change-Id: I1b857d9f28b994fba1e783d2e3bc176a6ef87952
Author: Kelly