From 56a3c72ffe526b69a10a3a9d5553d5c40ef3876d Mon Sep 17 00:00:00 2001
From: mattijs <mattijs>
Date: Fri, 15 Oct 2010 16:25:27 +0100
Subject: [PATCH] ENH: wmakeScheduler : work with both bash and csh

---
 wmake/wmakeScheduler | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/wmake/wmakeScheduler b/wmake/wmakeScheduler
index bfff68053a9..fc60b9be4dd 100755
--- a/wmake/wmakeScheduler
+++ b/wmake/wmakeScheduler
@@ -48,6 +48,11 @@
 #         eg,  export WM_NCOMPPROCS=$(wmakeScheduler -count)
 #
 #-------------------------------------------------------------------------------
+
+# csh sets HOST, bash sets HOSTNAME
+: ${HOST:=$HOSTNAME}
+
+
 lockDir=$HOME/.$WM_PROJECT/.wmake
 # fallback - 1 core on current host
 : ${WM_HOSTS:=$HOST:1}
@@ -184,14 +189,14 @@ do
                     # Set colour
                     colour="${colourList[$colourIndex]}"
 
-                    if [ "$host" = "$HOSTNAME" ]; then
+                    if [ "$host" = "$HOST" ]; then
                         eval $* 2>&1 | colourPipe "$colour"
                     else
                         ssh $host "$sourceFoam 2>/dev/null; cd $PWD && $rcmd" 2>&1 | colourPipe "$colour"
                     fi
                     retval=$?
                 else
-                    if [ "$host" = "$HOSTNAME" ]; then
+                    if [ "$host" = "$HOST" ]; then
                         eval $* 2>&1
                     else
                         ssh $host "$sourceFoam 2>/dev/null; cd $PWD && $rcmd" 2>&1
-- 
GitLab