Stop action in a nested for loop and resume it afterwards

Probably not an answer to this particular problem, but a side note for OP:

  1. You still didn't use shellcheck.net as you were previously requested to, it would have told you that e.g.:
Line 29:
if [ ! -f slurm-* ];
          ^-- SC2144 (error): -f doesn't work with globs. Use a for loop.
  1. Beware of mv CrSBr* CrSBr-Field-Cooling.slurm; as it would probably fail with
    mv: target 'CrSBr-Field-Cooling.slurm' is not a directory
  2. You most likely don't need 5 nested "for loops", you'd be perfectly fine with a single one (and a correctly used "brace expansion" mechanism); and you don't need copious number of cds - see my reply to your previous post.
2 Likes