]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
execute commands in modified environment
authormkrzewic <mikolaj.krzewicki@cern.ch>
Mon, 8 Dec 2014 13:00:21 +0000 (14:00 +0100)
committermkrzewic <mikolaj.krzewicki@cern.ch>
Mon, 8 Dec 2014 13:05:21 +0000 (14:05 +0100)
instead of sourcing and using the functions directly now it is also possible
to use the functions like this:

  $ALICE_ROOT/PWGPP/scripts/utilities.sh functionName args

it makes debugging easier, e.g.

  bashdb $ALICE_ROOT/PWGPP/scripts/utilities.sh guessRunNumber 000123123

PWGPP/scripts/utilities.sh [changed mode: 0644->0755]

old mode 100644 (file)
new mode 100755 (executable)
index edf41f6..ce97a07
@@ -1,3 +1,4 @@
+#!/bin/bash
 #library of useful PWGPP related bash functions
 #it REQUIRES BASH 4 !!!!
 #blame: Mikolaj Krzewicki, mkrzewic@cern.ch
@@ -714,3 +715,8 @@ paranoidCopyFile()
   return 1
 )
 
+#this makes debugging easier:
+#executes the command given as an argument in this environment
+#use case:
+#  bashdb utilities.sh summarizeLogs * */*
+[[ $# != 0 ]] && eval "$@"