bash solution for setting array value