5

Is there a way to submit a job to slurm with sbatch as record the job id into a variable?

job_id = sbatch --account my_account some_script.sh

echo $job_id

17210254
RMM
  • 313
  • 2
  • 11

1 Answers1

7

This can be done with --parsable

job_id=$(sbatch --parsable test.sh)
echo $job_id
17211434
RMM
  • 313
  • 2
  • 11