File: marionnet_from_scratch_weights_of_log

package info (click to toggle)
marionnet 0.90.6%2Bbzr508-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 9,532 kB
  • sloc: ml: 18,130; sh: 5,384; xml: 1,152; makefile: 1,003; ansic: 275
file content (17 lines) | stat: -rwxr-xr-x 411 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!/bin/bash

function cutv {
 awk "(f==0)&&/$1/{f=1;print;next}  (f==1)&&/$2/{print;f=2;next} (f==1){print;next}";
}

LOGFILE=${1:-/dev/stdin}

grep <$LOGFILE '^CHECKPOINT[:][ ]' \
  | { read line0;
      while [[ "$line0" != '___EnD_of_FiLe___' ]] ; do
	line1=$(read z && echo $z || echo '___EnD_of_FiLe___')
	W=$(cutv <$LOGFILE "$line0" "$line1" | wc -c)
	echo "$line0 => $W"
	line0="$line1"
      done
    }