Line Code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
#!/bin/bash

if [[ "$#" == "0" ]]; then
    echo "usage: 'moduleOccupancyTrend.sh RootFileDirectory Dataset ModuleListFile UserCertFile UserKeyFile RunListFile'";
    exit 1;
fi

mkdir /data/users/tmpTrend
cp $6  /data/users/tmpTrend/.
cp $3  /data/users/tmpTrend/.

cd  /data/users/tmpTrend

rm -f modulefile

cat $6 | while read line
do

moduleOccupancyPlots.sh $1 $2 $line $3 $4 $5

done

ls *.root > rootfilestmp.txt

cat $3 | while read line
do
echo $line >> modulefile
done

echo "Summary" >> modulefile

moduleOccupancyTrend rootfilestmp.txt modulefile $7 $8

rm modulefile
rm rootfilestmp.txt

cd -

cp  /data/users/tmpTrend/* .
rm -rf  /data/users/tmpTrend