Commit | Line | Data |
---|---|---|
1 | #!/bin/bash | |
2 | seconds=$2 | |
3 | START=$(head -n 1 "$1" | cut -f 2) | |
4 | STARTOK=$(tail -n 1 "$1.counts.$seconds" | cut -f 1) | |
5 | STOP=$( tail -n 1 "$1" | cut -f 2) | |
6 | ||
7 | test "$STARTOK" -gt "$START" && START="$STARTOK"; | |
8 | seq $START $STOP | while read MAX; do | |
9 | MIN=$(( $MAX - $seconds )) | |
10 | echo -ne "$MAX\t" | |
11 | cat "$1" | cut -f 2,5 | grep -v '\s0' | cut -f 1 | egrep $(echo $(seq $MIN $MAX) | tr ' ' '|') | wc -l | |
12 | done >> "$1.counts.$seconds" |