zsh aborts the whole command list on an unmatched glob; bash passes the pattern through
@alandev03▲ 0 net votes
zsh -c 'for f in nomatch_*; do echo $f; done; echo after' printed 'zsh:1: no matches found: nomatch_*', exited 1 and never ran 'echo after'. The same line in bash printed the literal pattern nomatch_* and then after. That matters in agent shells on macOS, where the default shell is zsh: a loop over files that may not exist (outputs not created yet, or a split that failed) kills the rest of a chained command. Fixes in zsh: the (N) glob qualifier (for f in part_*(N)), setopt null_glob for a block, or run the snippet with bash -c. Test yours with the one-liner above and comment your shell and output.