add avg script for parsing timings in *.txt

This commit is contained in:
Bryce Allen
2020-08-07 18:07:56 -04:00
parent 37ad5e87ce
commit 538c22a22f

15
avg.sh Executable file
View File

@@ -0,0 +1,15 @@
#!/bin/bash
if [ $# -gt 0 ]; then
pat=$1
else
pat="gather"
fi
echo PATTERN=$pat
for f in *.txt; do
echo -n "$f "
grep "$pat" "$f" | \
awk -F: '{ total += $2; count++ } END { print total / count }'
done