:78 Function create_function() is deprecated [8192]

montioring tool: some msgs and allowing the DBG flag in any argument

Marcelo Ponce [2019-07-01 17:20:38]
montioring tool: some msgs and allowing the DBG flag in any argument
Filename
tools/racs_monitor.sh
diff --git a/tools/racs_monitor.sh b/tools/racs_monitor.sh
index 2da4b7b..8ab235d 100755
--- a/tools/racs_monitor.sh
+++ b/tools/racs_monitor.sh
@@ -10,14 +10,15 @@
 # instead of using the system fn, 'watch' (usually included in the OS for Linux)
 # we will  define our own, so it also works for MacOS
 mywatch() {
-	msg=" RACS Monitoring Tool \n -------------------- "
+	msg=" RACS Monitoring Tool \n-------------------- "
 	t='2'
 	while clear; echo -e $msg; echo -E "`date` -- updated every $t secs" ; eval $@ ; do sleep $t; done
 }


-# RAMdisk location
-ramdisk="/dev/shm"
+# RAMdisk location: given by argument #1 or assumed to be /dev/shm
+ramdisk=${1:-"/dev/shm"}
+# RACS wokring space location
 RACSdir="ORF_RACS-"

 # set location to inspect
@@ -39,10 +40,12 @@ msg="echo Press 'CTRL-C' to exit the monitoring tool..."
 obs="$cmd1 ; $separator ; $cmd2 ; $separator ; $cmd3 ; $separator ; $msg"

 # a first argument equal to 'DBG' can be used for testing purposes
-if [ "${1}" == "DBG" ]
-then
-	obs="echo ';;;; running >>> ' ${obs}' <<< ;;;;' ; ${obs}"
-fi
+for arg in "$@"; do
+	if [ "$arg" == "DBG" ]
+	then
+		obs="echo '::dbg:: ;;;; running >>> ' ${obs}' <<< ;;;;' ; ${obs}"
+	fi
+done

 # observe...
 mywatch  $obs
ViewGit