create a diroctory only if input is exitsting
[u/mrichter/AliRoot.git] / TPC / scripts / makeWorkspace.sh
CommitLineData
d1513470 1#
2# marian.ivanov@cern.ch
05e3ee70 3# argument 1 - run.list
d1513470 4#
5# Make workspace structure
6# Create a list for each run
7# and make directory structure
acd4c700 8# This is fast procedure
9#
d1513470 10mydir=`pwd`
05e3ee70 11runlist=$1
c742847d 12minfiles=$2
acd4c700 13touch raw.list
14touch esd.list
05e3ee70 15for adir in `cat $runlist`; do
c742847d 16 rm -f tmp.rlist
17 cat $mydir/raw.list | grep $adir >>tmp.rlist
18 cat $mydir/esd.list | grep $adir >>tmp.rlist
19 nfiles=`wc -l <tmp.rlist`
20 echo Run $arun nfiles $nfiles
21 rm tmp.rlist
22 if [ $nfiles -gt $minfiles ] ; then
23 echo Creating dir $adir
24 mkdirhier $adir;
25 rm -f raw${adir}.txt
26 rm -f esd${adir}.txt
27 cat $mydir/raw.list | grep $adir >raw${adir}.txt
28 cat $mydir/esd.list | grep $adir >esd${adir}.txt
29 cp raw${adir}.txt ${adir}/raw.txt
30 cp esd${adir}.txt ${adir}/esd.txt
31 cp raw${adir}.txt ${adir}/raw.txt.Good
32 cp esd${adir}.txt ${adir}/esd.txt.Good
33 else
34 echo No input for run $adir
35 fi;
acd4c700 36done;
37
d1513470 38
39