Skip to main content
1 of 6
jlliagre
  • 62.5k
  • 11
  • 123
  • 162
i=0
while true; do
a[$i]=foo
i=$((i+1))
printf "\r%d " $i
done

This simple script shows:

  • ksh88 limits the size to 2^12-1 (4095). (subscript out of range )

  • ksh93 limits the size of a array to 2^22-1 (4194304)

  • bash doesn't impose any hard-coded limit outside the one dictated by the underlying memory resources available. For example bash uses 1.3 GB for an array size of 18074340.

jlliagre
  • 62.5k
  • 11
  • 123
  • 162