fix script to avoid glob expansion (which can exceed ARG_MAX)