Skip to main content
deleted 18 characters in body
Source Link
αғsнιη
  • 41.9k
  • 17
  • 75
  • 117
i=0
while true; do
    a[$i]=foo
    i=$((i+1))
    printf "\r%d " $i
done

This simple script shows on my systems (Gnu/Linux and Solaris):

  • ksh88 limits the size to 2^12-1 (4095). (subscript out of range ). Some older releases like the one on HP-UX limit the size to 1023.

  • ksh93 limits the size of a array to 2^22-1 (4194303), your mileage may vary.

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

Note: I gave up with mksh which was too slow executing the loop (more than one hundred times slower than zsh, ksh93 and bash.)

Edited to indent.

i=0
while true; do
    a[$i]=foo
    i=$((i+1))
    printf "\r%d " $i
done

This simple script shows on my systems (Gnu/Linux and Solaris):

  • ksh88 limits the size to 2^12-1 (4095). (subscript out of range ). Some older releases like the one on HP-UX limit the size to 1023.

  • ksh93 limits the size of a array to 2^22-1 (4194303), your mileage may vary.

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

Note I gave up with mksh which was too slow executing the loop (more than one hundred times slower than zsh, ksh93 and bash.)

Edited to indent.

i=0
while true; do
    a[$i]=foo
    i=$((i+1))
    printf "\r%d " $i
done

This simple script shows on my systems (Gnu/Linux and Solaris):

  • ksh88 limits the size to 2^12-1 (4095). (subscript out of range ). Some older releases like the one on HP-UX limit the size to 1023.

  • ksh93 limits the size of a array to 2^22-1 (4194303), your mileage may vary.

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

Note: I gave up with mksh which was too slow executing the loop (more than one hundred times slower than zsh, ksh93 and bash.)

i=0
while true; do
    a[$i]=foo
    i=$((i+1))
    printf "\r%d " $i
done

This simple script shows on my systems (Gnu/Linux and Solaris):

  • ksh88 limits the size to 2^12-1 (4095). (subscript out of range ). Some older releases like the one on HP-UX limit the size to 1023.

  • ksh93 limits the size of a array to 2^22-1 (4194303), your mileage may vary.

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

Note I gave up with mksh which was too slow executing the loop (more than one hundred times slower than zsh, ksh93 and bash.)

Edited to indent.

i=0
while true; do
a[$i]=foo
i=$((i+1))
printf "\r%d " $i
done

This simple script shows on my systems (Gnu/Linux and Solaris):

  • ksh88 limits the size to 2^12-1 (4095). (subscript out of range ). Some older releases like the one on HP-UX limit the size to 1023.

  • ksh93 limits the size of a array to 2^22-1 (4194303), your mileage may vary.

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

Note I gave up with mksh which was too slow executing the loop (more than one hundred times slower than zsh, ksh93 and bash.)

i=0
while true; do
    a[$i]=foo
    i=$((i+1))
    printf "\r%d " $i
done

This simple script shows on my systems (Gnu/Linux and Solaris):

  • ksh88 limits the size to 2^12-1 (4095). (subscript out of range ). Some older releases like the one on HP-UX limit the size to 1023.

  • ksh93 limits the size of a array to 2^22-1 (4194303), your mileage may vary.

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

Note I gave up with mksh which was too slow executing the loop (more than one hundred times slower than zsh, ksh93 and bash.)

Edited to indent.

added 68 characters in body
Source Link
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 on my systems (Gnu/Linux and Solaris):

  • ksh88 limits the size to 2^12-1 (4095). (subscript out of range ). Some older releases like the one on HP-UX limit the size to 1023.

  • ksh93 limits the size of a array to 2^22-1 (4194303), your mileage may vary.

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

Note I gave up with mksh which was too slow executing the loop (more than one hundred times slower than zsh, ksh93 and bash.)

i=0
while true; do
a[$i]=foo
i=$((i+1))
printf "\r%d " $i
done

This simple script shows on my systems (Gnu/Linux and Solaris):

  • ksh88 limits the size to 2^12-1 (4095). (subscript out of range ). Some older releases like the one on HP-UX limit the size to 1023.

  • ksh93 limits the size of a array to 2^22-1 (4194303), your mileage may vary.

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

Note I gave up with mksh which was too slow executing the loop.

i=0
while true; do
a[$i]=foo
i=$((i+1))
printf "\r%d " $i
done

This simple script shows on my systems (Gnu/Linux and Solaris):

  • ksh88 limits the size to 2^12-1 (4095). (subscript out of range ). Some older releases like the one on HP-UX limit the size to 1023.

  • ksh93 limits the size of a array to 2^22-1 (4194303), your mileage may vary.

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

Note I gave up with mksh which was too slow executing the loop (more than one hundred times slower than zsh, ksh93 and bash.)

added 65 characters in body
Source Link
jlliagre
  • 62.5k
  • 11
  • 123
  • 162
Loading
added 132 characters in body
Source Link
jlliagre
  • 62.5k
  • 11
  • 123
  • 162
Loading
Source Link
jlliagre
  • 62.5k
  • 11
  • 123
  • 162
Loading