grazinggoat
Programmer
Can someone explain why the array is being put back in itself?
I don't understand why this needs to happen FILE_ARRAY[ $(( IDX )) ]="${FILE_ARRAY[ $(( IDX )) ]} ${FILE}"
I don't understand why this needs to happen FILE_ARRAY[ $(( IDX )) ]="${FILE_ARRAY[ $(( IDX )) ]} ${FILE}"
Code:
set -A FILE_ARRAY
(( IDX = 0 )) ; (( COUNT = 0 ))
for FILE in ${FILES} ; do
(( COUNT += 1 ))
FILE_ARRAY[ $(( IDX )) ]="${FILE_ARRAY[ $(( IDX )) ]} ${FILE}"
(( COUNT % 100 == 0 )) && (( IDX += 1 ))
done