Fixes for reading zero-suppressed data. These should be propagated to
[u/mrichter/AliRoot.git] / FMD / scripts / checkSizes.sh
1 #!/bin/bash
2
3 extra=" DPMJET          \
4         TDPMjet         \
5         EPEMGEN         \
6         TEPEMGEN        \
7         HBTP            \
8         THbtp           \
9         HERWIG          \
10         THerwig         \
11         HIJING          \
12         THijing         \
13         ISAJET          \
14         TIsajet         \
15         LHAPDF          \
16         MEVSIM          \
17         TMEVSIM         \
18         MICROCERN       \
19         PDF             \
20         PYTHIA6         \
21         TPHIC"
22 base="  ALIFAST         \
23         ALIROOT         \
24         ANALYSIS        \
25         CONTAINERS      \
26         CRT             \
27         DISPLAY         \
28         EMCAL           \
29         EVE             \
30         EVGEN           \
31         FASTSIM         \
32         FLOW            \
33         FMD             \
34         HBTAN           \
35         HLT             \
36         ITS             \
37         JETAN           \
38         LHC             \
39         MONITOR         \
40         MUON            \
41         PHOS            \
42         PMD             \
43         PWG0            \
44         PWG2            \
45         PWG3            \
46         RALICE          \
47         RAW             \
48         HMPID           \
49         SHUTTLE         \
50         START           \
51         STEER           \
52         STRUCT          \
53         TOF             \
54         TPC             \
55         TRD             \
56         VZERO           \
57         ZDC"
58
59 cat <<EOF > exclude
60 */tgt_*/*
61 */html/*
62 .#*
63 */CVS*
64 *~ 
65 *.root
66 *.so
67 *.o
68 EOF
69
70 get_size()
71 {
72     s=`du -X exclude -kc $1 | tail -n 1 | awk 'BEGIN {FS=" "}{print $1}'`
73     printf "\t%-30s\t%10d kB\n" $1 $s 
74     total=`echo ${total} + ${s} | bc`
75 }
76     
77 echo "Extras:"
78 total=0
79 for e in $extra ; do 
80     get_size $e
81 done 
82 for i in `seq 1 56` ; do echo -n "-" ; done
83 mb=`echo $total / 1024 | bc` 
84 printf "\n\t%-30s\t%10d kB = %10d MB\n" "Total" $total $mb
85
86 echo "Base:"
87 total=0
88 for b in $base ; do 
89     get_size $b 
90 done 
91 for i in `seq 1 56` ; do echo -n "-" ; done
92 mb=`echo $total / 1024 | bc` 
93 printf "\n\t%-30s\t%10d kB = %10d MB\n" "Total" $total $mb
94
95         
96 rm -f exclude