From 947f3fea5064471d924a8474cf94becde4f97195 Mon Sep 17 00:00:00 2001
From: Henry Weller <http://cfd.direct>
Date: Wed, 16 Dec 2015 20:26:25 +0000
Subject: [PATCH] foamMonitor: change format to support old gnuplot versions
 Resolves bug-report http://openfoam.org/mantisbt/view.php?id=1952

---
 bin/foamMonitor | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/bin/foamMonitor b/bin/foamMonitor
index 9f70c745706..e38545f00d4 100755
--- a/bin/foamMonitor
+++ b/bin/foamMonitor
@@ -154,7 +154,12 @@ i=1
 for field in $KEYS
 do
     i=$(expr $i + 1)
-    echo "\"$FILE\" using 1:${i} with lines title \"$field\", \\" >> $GPFILE
+    PLOTLINE="\"$FILE\" using 1:${i} with lines title \"$field\""
+    if [[ $i -lt $NCOLS ]]
+    then
+       PLOTLINE="$PLOTLINE, \\"
+    fi
+    echo $PLOTLINE >> $GPFILE
 done
 plotFileFooter >> $GPFILE
 
-- 
GitLab