#!/bin/bash # Submit data extraction job and save the JobId for the dependency JOB_ID_EXTRACT_DATA=`sbatch extract_data.slurm | cut -d " " -f 4` # The computation step is only executed if the data preparation step has run successfully sbatch --dependency=afterok:$JOB_ID_EXTRACT_DATA compute.slurm