6 puts stderr
"[lindex $argv0 0]: $msg"
9 foreach i
[glob -nocomplain ~
/.kde
/share
/apps
/kppp
/Log
/*-199?
] {
11 if {[catch { set fin
[open $i "r"] }]} {
12 err
"cannot open $i for reading"
16 if {[catch { set fout
[open ${i
}.log
"a"] }]} {
17 err
"cannot open ${i}.log for writing"
21 puts -nonewline "converting $i... "
25 while {[eof $fin] == 0} {
28 if {[regexp {(.
*:.
*:.
*):.
*:(.
*):.
*} $line s s1 s2
]} {
29 set date
[clock scan $s1]
34 puts -nonewline $fout "$date:$s2"
38 if {[regexp {(.
*:.
*:.
*):} $line s s1
]} {
39 set date
[clock scan $s1]
43 regexp {.
*:\ *([0-9.
]+)\ *(.
*)} $line1 s s1 s2
44 regexp {.
*:\ *([0-9.
]+)\ *(.
*)} $line2 s s3 s4
45 puts $fout ":$s2:$date:$s1:$s3:-1:-1"
52 # remove duplicate entries
53 if {[catch { exec cat
${i
}.log | sort
-n | uniq | egrep
{^
[0-9]} > ${i
}.log.new
} ret
]} {
54 err
"cannot sort ${i}.log $ret"
56 catch { exec mv
${i
}.log.new
${i
}.log
}
60 exec chmod
600 ${i
}.log