bash solution for setting array value

#1189