add a protection and a warning against running with bash version < 4
authormkrzewic <mikolaj.krzewicki@cern.ch>
Fri, 30 May 2014 18:27:05 +0000 (20:27 +0200)
committermkrzewic <mikolaj.krzewicki@cern.ch>
Fri, 30 May 2014 18:27:05 +0000 (20:27 +0200)
PWGPP/QA/scripts/runQA.sh

index 47f1183..339fba0 100755 (executable)
@@ -1,4 +1,9 @@
 #!/bin/bash
+if [ ${BASH_VERSINFO} -lt 4 ]; then
+  echo "bash version >= 4 needed, you have ${BASH_VERSION}, exiting..."
+  exit 1
+fi
+
 main()
 {
   if [[ -z $1 ]]; then
@@ -10,7 +15,7 @@ main()
     echo "  ${0##*/} configFile=runQA.config inputList=file.list outputDirectory=%det"
     return 1
   fi
+
   if ! parseConfig "$@"; then
     ${0}
     return 1