HW2: Measurement files for all-3 version and performance process scripts

This commit is contained in:
2025-01-08 15:52:17 +02:00
parent 3bf4522448
commit b8e05dbe7c
50 changed files with 4825 additions and 10 deletions
+18
View File
@@ -0,0 +1,18 @@
#! /usr/bin/env bash
#
# Usage: average <match> <file>
# ex: average Total ./myFile
#
grep -e "$1" "$2" | awk -v what="$1" -F: '
BEGIN {sum = 0; count = 0; units = ""}
{
split($2, parts, " ");
sum += parts[1]+0;
count++;
if (units == "") {
units = parts[2];
}
}
END {print what " (av):", sum/count, units}
'