From af8a35c539c82b837df1485c67b86f8082328bc7 Mon Sep 17 00:00:00 2001 From: Hyacinthe Cartiaux Date: Thu, 24 Aug 2017 15:32:03 +0200 Subject: [PATCH] [bash] Slurm integration, check if we are in an interactive shell --- bash/bash_slurm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bash/bash_slurm b/bash/bash_slurm index 7b6888a..2415c4b 100755 --- a/bash/bash_slurm +++ b/bash/bash_slurm @@ -9,7 +9,7 @@ __slurm_ps1_remaining_time(){ fi } -test -n "$SLURM_PTY_PORT" && ( +[[ -n "$INTERACTIVE" && -n "$SLURM_PTY_PORT" ]] && ( echo "[SLURM] SLURM_JOB_ID=$SLURM_JOB_ID" echo "[SLURM] Your nodes are:" srun bash -c 'echo " $(hostname)*$SLURM_CPUS_ON_NODE"' | sort -u