Try this modiufied version of your script :
Code:
cpfiles=""
counter=0
IMAGECOPYCOUNTER=100
exec <imagefiles.list
while read line
do
cpfiles="$cpfiles \"$line\""
(( counter = counter + 1 ))
(( remainder = counter % IMAGECOPYCOUNTER))
if [ $remainder -eq 0 ];then
eval cp $cpfiles ./myimages
cpfiles=""
fi
done
Attention, if the number of files to copy is not exactly a multiple of 100, some files will not be copied.
You can also do the work with
tar depending of your Unix flavor.
If the -T option (-I for some systems) is supported :
Code:
tar cTf imagefiles.list - | ( cd myimages; tar xf - )