I have a bash script that runs a model using sbatch. The commands/processes that follow the sbatch command depend upon outputs from the sbatch job. Is there a way in bash to have the script wait until the sbatch job is finished? I don't want to use the 'sleep' command with an arbitrary/appx. duration because the model can take different times to run.
The flow of the script is like:
export SOME_STUFF
#define paths
#run the model w/
sbatch ./job_card
#now wait until job finishes before running remaining commands which depend on sbatch outputs; e.g., mv, cp, ncks...
Thank you!