I've got something fairly simple I want to do. I want to use montage on a directory that contains thousands of images, with very few options, namely:me@home$ montage -size 256x256 DSC01*.JPG.svg output.png...but that's just not good enough, as it only grabs about 100 images at a time; neither isme@home$ montage -size 256x256 *.svg output.png...which grabs all of the images at the same time, as the resulting file is too big to parse.What I want to do is to iterate over something like 100-200 files at a time. I  guess this could be implemented using a for loop (?), but I'm just a bit confused about how to do that. I guess there's probably a clever way to use find -exec or xargs that I'm not thinking of. I'm using bash, but I use zsh occasionally.So, in conclusion, I'm looking for a one liner that, given 2600 image files, calls montage about 13 or 26 times (once for each 100-200 files), and given n files, can be called a multiple of n times.
Iterate over n files?
shell;imagemagick
A bash method, using special array features; probably translatable to zsh with some modification:image_files=(*.svg) # use your own glob expressionn=200               # number of files per command line; adjust to tastefor ((i=0; i < ${#image_files[@]}; i+=n)); do        montage -size 256x256 ${image_files[@]:i:n} output-$i.pngdone