diff --git a/tt/sum.sh b/tt/sum.sh new file mode 100755 index 0000000..29bce12 --- /dev/null +++ b/tt/sum.sh @@ -0,0 +1,11 @@ +#!/bin/bash + +function get_sum() { + cut -d";" -f4 "$1.csv" | tail -n+2 | paste -sd+ | bc +} + +hil=$(get_sum "HIL") +ste=$(get_sum "STE") +total=$(echo "$hil+$ste" | bc) + +echo -e "HIL:\t$hil\nSTE:\t$ste\nTotal:\t$total"