diff --git a/doc.zih.tu-dresden.de/docs/jobs_and_resources/slurm_examples.md b/doc.zih.tu-dresden.de/docs/jobs_and_resources/slurm_examples.md index b4d8182d6b788f4a39dab3e2dda9b23dfb7266c6..0322c2ce97f2801b4250d409718b36ab9b64f9fb 100644 --- a/doc.zih.tu-dresden.de/docs/jobs_and_resources/slurm_examples.md +++ b/doc.zih.tu-dresden.de/docs/jobs_and_resources/slurm_examples.md @@ -394,16 +394,16 @@ In the following we provide two examples for scripts that submit chain jobs. dependency="" arraylength=${#job_names[@]} - for (( i=0; i<${arraylength}; i++ )) ; do - job_nr=`expr $i + 1` + for (( i=0; i<arraylength; i++ )) ; do + job_nr=$((i + 1)) echo "Job ${job_nr}/${arraylength}: ${job_names[$i]}" - if [ -n "${dependency}" ] ; then + if [ -n "${dependency}" ] ; then echo "Dependency: after job ${dependency}" dependency="--dependency=afterany:${dependency}" - fi + fi job="sbatch ${dependency} ${job_names[$i]}" - out=`${job}` - dependency=`echo ${out} | awk '{print $4}'` + out=$(${job}) + dependency=$(echo "${out}" | awk '{print $4}') done ```