#!/bin/bash set -x array_counter=0 array_value=1 array=(0 0 0) for number in ${array[@]} do array[$array_counter]=\"$array_value\" array_counter=$(($array_co
Your example actually works.
echo ${array[@]}
confirms this.
You might try more efficient way of incrementing your index:
((array_counter++))