(0 . 0)(1 . 18)
35 #!/bin/bash
36
37 if [ "$#" -ne 1 ]; then
38 echo "Usage: $0 startIndex"
39 exit 1
40 fi
41
42 awk -v mindex=$1 '/Day changed/ {Month=$5; Day=$6; Year=$7;}
43 /Log opened/ {Month=$5; Day=$6; Year=$10;}
44 ! /-|<--|>/ {count++; sep=";";
45 w= Year " " Month " " Day " " $1 " " $2 " 00";
46 if ($3 == "*") {
47 pp=$3 sep $4 " "; $4=""; n=5;
48 } else {
49 pp=$3 sep; n=4;};
50 $1=""; $2=""; $3="";
51 print count+mindex-1 sep mktime(w) sep pp substr($0,n);
52 }'