How to create a function or alias to shorten sbatch dependency?

42 Views Asked by At

I am trying to write a function or alias to include in my .bashrc to shorten sbatch --dependency=afterany:job_id jobfile

I have tried function sbd() { sbatch --dependency=afterany:$1 $2 }

and

alias='sbatch --dependency=afterany:$1 $2'

and

alias='sbatch --dependency=afterany:'

The issue is if I enter the jobID for $1 it tries to open it as a file. I am not sure of how to, or if it is possible to get it to recognize as a jobID. I know slurm has a variable $SLURM_JOB_ID, but I do not know how to get my input to be recognized as this or if it is even possible. Thanks for the help!

0

There are 0 best solutions below