Add protection: do not replace // in raw://
authordstocco <diego.stocco@cern.ch>
Thu, 8 Jan 2015 10:35:22 +0000 (11:35 +0100)
committermorsch <andreas.morsch@cern.ch>
Thu, 8 Jan 2015 15:04:45 +0000 (16:04 +0100)
PWGPP/scripts/utilities.sh

index ac751b1..5de647e 100755 (executable)
@@ -181,7 +181,10 @@ setYear()
   local path=${2}
   [[ ${yearSource} -ne ${yearTarget} && -n ${yearTarget} && -n ${yearSource} ]] \
     && path=${2/\/"${yearTarget}"/\/"${yearSource}"}
-  echo ${path/\/\//\/}
+  path=${path/\/\//\/}
+  # The previous line would transform raw:// in raw:/
+  # The next fixes this
+  echo ${path/%:\//:\/\/}
   return 0
 }