diff options
author | John Ankarström <john@ankarstrom.se> | 2020-12-13 01:53:48 +0100 |
---|---|---|
committer | John Ankarström <john@ankarstrom.se> | 2020-12-13 01:54:19 +0100 |
commit | da7ec287a7e9930794667d274582f0893602712d (patch) | |
tree | 4a9620a5c3c92d7467945766e405e3d4f199cec8 | |
parent | b1e14c8893656a01b62a4967cb6102ce3e9015b6 (diff) | |
download | typ-master.tar.gz |
dif calculates the difference between two avg results stored in
separate files.
-rwxr-xr-x | dif | 14 |
1 files changed, 14 insertions, 0 deletions
@@ -0,0 +1,14 @@ +#!/bin/sh + +# dif -- print differences between two typ result files + +awk -vn=`wc -l "$1" | cut -d\ -f1` ' + NR <= n { + v[FNR] += $1 + $1 = "" + sub(/^ /, "", $0) + t[FNR] = $0 + } + NR > n { + printf("%.4f\t%s\n", v[FNR] - $1, t[FNR]) + }' "$1" "$2" |