I have to run multiple of those scripts AFTER all the Slurms from the preceeding job are finished. Now I want to write a script that does exactly that. I already tried something like this:
the problem seems to be that the skript thinks that testscript1.sh is done as soon as it submitted all the slurms in the array to the server and then it starts testscript2.sh. This leads to problems because testscript2.sh works with some files that are only created when the submitted slurms from testscript1.sh are done.
So the two commands will be executed immediately after one another. The wait statement has no function here, since no shell controlled background jobs are specified/used in the shell script.
So you will need to create dependencies between jobs. Did you checkout the -d option?