diff options
author | Trygve Laugstøl <trygvis@inamo.no> | 2017-04-07 13:02:41 +0200 |
---|---|---|
committer | Trygve Laugstøl <trygvis@inamo.no> | 2017-04-07 13:02:41 +0200 |
commit | 9eb76adec8d6a6f15a461da7c5e1e6920a92105a (patch) | |
tree | 42b4759b463edb2c76bcdd94077ac0acc3b95da1 /tri-batcher | |
parent | 384817a40c541ee48da3bdb5f88508fe871acf38 (diff) | |
download | wifi-triangulator-9eb76adec8d6a6f15a461da7c5e1e6920a92105a.tar.gz wifi-triangulator-9eb76adec8d6a6f15a461da7c5e1e6920a92105a.tar.bz2 wifi-triangulator-9eb76adec8d6a6f15a461da7c5e1e6920a92105a.tar.xz wifi-triangulator-9eb76adec8d6a6f15a461da7c5e1e6920a92105a.zip |
o Better logging.
Diffstat (limited to 'tri-batcher')
-rwxr-xr-x | tri-batcher | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/tri-batcher b/tri-batcher new file mode 100755 index 0000000..4413100 --- /dev/null +++ b/tri-batcher @@ -0,0 +1,28 @@ +#!/bin/bash + +cmd=$(echo ${@}) + +time_buffer=3 + +rm -f buf + +now=$(date +%s) +ts=$d +while read contents +do + echo $contents >> buf + + # echo now=$now, ts=$ts + if (($ts + $time_buffer < $now)) + then + ts=$now + echo "$d Buf size: " $(wc -l buf) >/dev/stderr + $cmd < buf + rm buf + fi + now=$(date +%s) +done + +echo "$d Buf size: " $(wc -l buf) >/dev/stderr +$cmd < buf +rm buf |