From ee43bd527de470c2d7651cfa4f6efee830b89de1 Mon Sep 17 00:00:00 2001 From: pgueth Date: Mon, 7 Mar 2011 11:19:39 +0100 Subject: [PATCH] merge release script --- cluster_tools/mergeStatFile.sh | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100755 cluster_tools/mergeStatFile.sh diff --git a/cluster_tools/mergeStatFile.sh b/cluster_tools/mergeStatFile.sh new file mode 100755 index 0000000..20eb20a --- /dev/null +++ b/cluster_tools/mergeStatFile.sh @@ -0,0 +1,27 @@ +#!/bin/bash +set -u +set -e + +function usage { + echo "$0 -i -j -o " + exit 1 +} + +if [ $# != 6 ] +then + usage +fi + +IN1=$2 +IN2=$4 +RESULT=$6 + +TMP=`mktemp ./temp-XXXXXXX` +for PARAM in `awk '$1 == "#" {print $2}' ${IN1}` +do + V1=`awk -v P=${PARAM} '$2 == P {print $4}' ${IN1} ` + V2=`awk -v P=${PARAM} '$2 == P {print $4}' ${IN2} ` + R=`echo "${V1} + ${V2}" | bc` + echo "# ${PARAM} = ${R}" >> ${TMP} +done +mv -f ${TMP} ${RESULT} -- 2.47.1