Skip to content

Instantly share code, notes, and snippets.

@mjhong0708
Last active September 14, 2021 06:16
Show Gist options
  • Save mjhong0708/4410fac8571391d23072b7040e0683d0 to your computer and use it in GitHub Desktop.
Save mjhong0708/4410fac8571391d23072b7040e0683d0 to your computer and use it in GitHub Desktop.
gotojob
function gotojob {
if (( $# == 0 )); then
echo "gotojob v0.1.0 by Minjoon Hong"
echo "change current directory to working directory of a slurm job"
echo "usage: $FUNCNAME [SLURM_JOBID]"
return
fi
workdir=$(scontrol show job $1 | grep Dir | awk -F '=' '{print $2}')
cd $workdir
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment