From: minima Date: Tue, 5 Dec 2000 13:51:33 +0000 (+0000) Subject: added hex decodes for 0-1f 7f-ff in watchdbg and grepdbg X-Git-Tag: R_1_45~8 X-Git-Url: http://dxspider.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=b08d8e083dd9762d205f68ada2bf56bd0a8acd90;p=spider.git added hex decodes for 0-1f 7f-ff in watchdbg and grepdbg --- diff --git a/Changes b/Changes index be14fb27..461f3697 100644 --- a/Changes +++ b/Changes @@ -2,6 +2,8 @@ 1. fix frequency hinting routine so it correctly handles things like 'on 23cm' where digits are the 'wrong' way round. 2. made default max days to search for spots 3 months. +3. added hex decodes for those pesky 'national' characters that aren't really +in grepdbg and watchdbg. 03Dec00======================================================================= 1. change grepdbg and watchdbg so that you can see a number of lines before the condx that you are looking for so:- diff --git a/perl/grepdbg b/perl/grepdbg index 35c9a748..5b95c633 100755 --- a/perl/grepdbg +++ b/perl/grepdbg @@ -62,6 +62,7 @@ for my $entry (@list) { shift @prev while @prev > $nolines; if ($line =~ m{$string}io) { for (@prev) { + $line =~ s/([\x00-\x1f\x7f-\xff])/sprintf("\\x%02X", ord($1))/eg; my @line = split '\^'; my $t = shift @line; print atime($t), ' ', join('^', @line), "\n"; diff --git a/perl/watchdbg b/perl/watchdbg index 6058ed64..79755296 100755 --- a/perl/watchdbg +++ b/perl/watchdbg @@ -73,12 +73,14 @@ sub printit { while (@_) { my $line = shift; + chomp $line; + $line =~ s/([\x00-\x1f\x7f-\xff])/sprintf("\\x%02X", ord($1))/eg; my @line = split '\^', $line; my $t = shift @line; my ($sec,$min,$hour) = gmtime((defined $t) ? $t : time); my $buf = sprintf "%02d:%02d:%02d", $hour, $min, $sec; - print $buf, ' ', join('^', @line); + print $buf, ' ', join('^', @line), "\n"; } } exit(0);