#!/bin/bash ID=$(sbatch --parsable $1) shift for script in "$@"; do ID=$(sbatch --parsable --dependency=afterany:${ID} $script) done