On Sat, Dec 30, 2023 at 9:43 AM Ray Andrews wrote: > > I'm using zmv to rename files in a directory tree recursively via a > 'for' loop which visits each subdirectory. It works fine if there are > files found to rename, but if not, then the entire function crashes back > to CL. How can I persuade zmv to just let the function cycle to the > next subdir? zmv forces zsh emulation which means the nomatch option is in effect, and you can't change that without editing the zmv source. Just run the zmv in a subshell: ( zmv '(*).SNT' '$1.eml' ) ( zmv '(*).MES' '$1.eml' ) Also make sure that you don't have the errr_exit or err_return setopts in effect or the loop will break even with the subshells. Alternately you could test whether the pattern matches any files before calling zmv in the first place. Arguably zmv could use null_glob. Thoughts from -workers?