#!/bin/bash
JID_JOB1=`sbatch  job1.slurm | cut -d " " -f 4`
JID_JOB2=`sbatch  --dependency=afterok:$JID_JOB1 job2.slurm | cut -d " " -f 4`
JID_JOB3=`sbatch  --dependency=afterok:$JID_JOB2 job3.slurm | cut -d " " -f 4`
sbatch  --dependency=afterok:$JID_JOB3 job4.slurm