1
0
Fork 0
mirror of https://github.com/hcartiaux/dotfiles.git synced 2024-10-18 09:15:24 +02:00

[bash] slurm - fix shellcheck induced bug

This commit is contained in:
Hyacinthe Cartiaux 2019-02-05 16:06:11 +01:00
parent 044b2f3c39
commit 15349a71c7

View file

@ -14,7 +14,7 @@ __slurm_ps1_remaining_time() {
[[ -n $INTERACTIVE && -n $SLURM_PTY_PORT ]] && (
echo "[SLURM] SLURM_JOB_ID=${SLURM_JOB_ID}"
echo "[SLURM] Your nodes are:"
[[ $(echo "$SLURM_JOB_CPUS_PER_NODE" | grep -q '(x') ]] && nbcpu=$(echo "$SLURM_JOB_CPUS_PER_NODE" | grep -o '^[^(]*' )
[[ $(echo "$SLURM_JOB_CPUS_PER_NODE" | grep '(x') ]] && nbcpu=$(echo "$SLURM_JOB_CPUS_PER_NODE" | grep -o '^[^(]*' )
for node in $(scontrol show hostname "$SLURM_JOB_NODELIST") ; do
i=$((i+1))
echo " ${node}*${nbcpu:-$(echo "$SLURM_JOB_CPUS_PER_NODE" | cut -d, -f$i)}"