fix script to work with arrays using bash instead of sh

Change-Id: I5a17cc90f8b523d9d7899bb4367da3acfbf3e002
Merge pull request #22 from CyanogenMod/cm-10.1

fix script to work with arrays using bash instead of sh