First page Back Continue Last page Graphics

Wait! There's a problem!

#! /bin/bash

declare -a newArray

declare -i i=0

newArray[0]=1

newArray[3]=99

echo newArray has ${#newArray[*]} elements

while (( i < 5 )); do

printf "[%d]=%s " $i ${newArray[$i]}

let i++

done

printf "\n"

On stdout:

newArray has 2 elements

[0]=1 [1]=0 [2]=0 [3]=99 [4]=0