From d3354604b6d43bedc309be350e66a569bbb02bb7 Mon Sep 17 00:00:00 2001 From: "Eric T. Johnson" Date: Tue, 10 Sep 2024 15:19:19 -0400 Subject: [PATCH] Don't fail if $SCRATCH isn't set --- job_scripts/slurm/chainslurm-menu.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/job_scripts/slurm/chainslurm-menu.sh b/job_scripts/slurm/chainslurm-menu.sh index 5e0129d..853f64a 100755 --- a/job_scripts/slurm/chainslurm-menu.sh +++ b/job_scripts/slurm/chainslurm-menu.sh @@ -73,9 +73,13 @@ if [[ "$oldjob" -gt 0 ]]; then old_dir=$(readlink -f "$old_dir") new_dir=$(readlink -f "$PWD") if [[ "$old_dir" != "$new_dir" ]]; then - old_pretty="${old_dir/$SCRATCH/\$SCRATCH}" + old_pretty=$old_dir + new_pretty=$new_dir + if [[ -n ${SCRATCH+x} ]]; then + old_pretty="${old_pretty/$SCRATCH/\$SCRATCH}" + new_pretty="${new_pretty/$SCRATCH/\$SCRATCH}" + fi old_pretty="${old_pretty/$HOME/\~}" - new_pretty="${new_dir/$SCRATCH/\$SCRATCH}" new_pretty="${new_pretty/$HOME/\~}" echo "Error: selected job was submitted from ${old_pretty}, but you are currently in ${new_pretty}" exit 2