From 6e5ea1275cb6ec83b0fe018ec76a57cbd772c75b Mon Sep 17 00:00:00 2001
From: Simon Rose <simon.rose@ess.eu>
Date: Thu, 17 Jun 2021 16:11:58 +0200
Subject: [PATCH] use grep -E

---
 tests/test_versions/test.sh | 17 ++++-------------
 1 file changed, 4 insertions(+), 13 deletions(-)

diff --git a/tests/test_versions/test.sh b/tests/test_versions/test.sh
index e3b6a486..a168aa1f 100755
--- a/tests/test_versions/test.sh
+++ b/tests/test_versions/test.sh
@@ -7,14 +7,12 @@ EPICS_BASE=${EPICS_BASE:-/epics/base-7.0.5}
 REQUIRE_VER=${E3_REQUIRE_VERSION:-3.4.1}
 
 if which ack &>/dev/null; then
-  __use_ack=true
+  __SEARCH_COMMAND__="ack --passthru"
 else
   echo "ack is not installed; defaulting to grep, but note that the log will be missing the IOC log" >&2
-  __use_ack=false
+  __SEARCH_COMMAND__="grep -E"
 fi
 
-#__use_ack=false
-
 function usage {
   echo "Usage:"
   echo "  bash test.sh [-b <EPICS_BASE>] [-r <REQUIRE_VER>] [-h] testfile"
@@ -67,13 +65,8 @@ function test_require {
   echo "Installed: ${args[*]}"
   echo "============================================================"
 
-  if [ "$__use_ack" = true ]; then
-    required=${required//+/\\+}
-    expected=${expected//+/\\+}
-    __SEARCH_COMMAND__="ack --passthru"
-  else
-    __SEARCH_COMMAND__="grep"
-  fi
+  required=${required//+/\\+}
+  expected=${expected//+/\\+}
 
   clean_vers
 
@@ -91,8 +84,6 @@ function test_require {
     search_string="^Loaded $MODULENAME version $expected\$"
   fi
 
-  echo "SEARCH STRING: $search_string"
-
   # The funny sed command here is from https://unix.stackexchange.com/a/235016/445931
   # The reason this is needed is because the "Starting iocInit" message seems to be threaded
   # differently than the regular flow of output and sometimes will separate the strings that
-- 
GitLab