if [[ "${firstpartialoutputfile}" == *Uncertainty* ]]
then
- if test "${firstpartialoutputextension}" == "mhd" || test "${firstpartialoutputextension}" == "mha"
+ if test "${firstpartialoutputextension}" == "mhd" || test "${firstpartialoutputextension}" == "mha"
then
echo "${indent}Uncertainty file found: ${firstpartialoutputfile}"
## search for sum
echo "${indent}${squared_merged_file} found"
## search for NumberOfEvent
totalEvents=0;
- for outputfile in $(find -L "${rundir}" -regextype 'posix-extended' -type f -regex "${rundir}/output.*\.(hdr|mhd|mha|root|txt)" | awk -F '/' '{ print $NF; }' | sort | uniq)
+ unamestr=`uname`
+ if [[ "$unamestr" == 'Darwin' ]]; then
+ files=$(find -L "${rundir}" -type f -regex ".*output.*[hdr|mhd|mha|root|txt]" | awk -F '/' '{ print $NF; }' | sort | uniq)
+ else
+ files=$(find -L "${rundir}" -regextype 'posix-extended' -type f -regex "${rundir}/output.*\.(hdr|mhd|mha|root|txt)" | awk -F '/' '{ print $NF; }' | sort | uniq)
+ fi
+ echo $files
+ for outputfile in ${files}
do
#echo $outputfile
if grep -q 'NumberOfEvent' "${outputdir}/${outputfile}"
warning "${totalEvents} not positive. A at least one stat file (SimulationStatisticActor) must be provided. Error, no uncertainty computed"
return;
fi
- else
+ else
error "merge_dispatcher_uncertainty does not handle ${firstpartialoutputfile} files"
fi
fi
test -d "${outputdir}" && rm -r "${outputdir}"
mkdir "${outputdir}"
-for outputfile in $(find -L "${rundir}" -regextype 'posix-extended' -type f -regex "${rundir}/output.*\.(hdr|mhd|mha|root|txt)" | awk -F '/' '{ print $NF; }' | sort | uniq)
+
+unamestr=`uname`
+if [[ "$unamestr" == 'Darwin' ]]; then
+ files=$(find -L "${rundir}" -type f -regex ".*output.*[hdr|mhd|mha|root|txt]" | awk -F '/' '{ print $NF; }' | sort | uniq)
+else
+ files=$(find -L "${rundir}" -regextype 'posix-extended' -type f -regex "${rundir}/output.*\.(hdr|mhd|mha|root|txt)" | awk -F '/' '{ print $NF; }' | sort | uniq)
+fi
+echo files $files
+for outputfile in ${files}
do
merge_dispatcher "${outputfile}" "${force}"
done
echo ""
echo "Merging done. Special case for statistical uncertainty"
-for outputfile in $(find -L "${outputdir}" -regextype 'posix-extended' -type f -regex "${outputdir}/.*\.(hdr|mhd|mha|root|txt)" | awk -F '/' '{ print $NF; }' | sort | uniq)
+
+unamestr=`uname`
+if [[ "$unamestr" == 'Darwin' ]]; then
+ files=$(find -L "${outputdir}" -type f -regex ".*[hdr|mhd|mha|root|txt]" | awk -F '/' '{ print $NF; }' | sort | uniq)
+else
+ files=$(find -L "${outputdir}" -regextype 'posix-extended' -type f -regex "${outputdir}/.*\.(hdr|mhd|mha|root|txt)" | awk -F '/' '{ print $NF; }' | sort | uniq)
+fi
+echo files = $files
+for outputfile in ${files}
do
merge_dispatcher_uncertainty "${outputfile}" "${force}"
done