typeset -i squares # declare array integers (for speed). i=0 while (( i < 10 )) do (( squares[$i] = i * i )) (( i = i + 1 )) done echo 5 squared is ${squares[5]} echo list of all squares is ${squares[*]}