Line Code
1 2 3 4 5 6 7 8 9 10 11 12 13
#!/bin/tcsh

set DIR=${1}
set LIST=${2}

foreach i (`cat ${LIST}`)
set NRUN=${i}
set list=`ls ${DIR}/Global_${NRUN}_*.root`
echo ${list}
hadd Global_${NRUN}.root ${list}
@ i = ${i} + "1"
end