+03Dec00=======================================================================
+1. change grepdbg and watchdbg so that you can see a number of lines before
+the condx that you are looking for so:-
+ grepdbg 3 LOOP
+ watchdbg 3 LOOP
+will show both the LOOP line and the preceeding 2 lines.
30Nov00=======================================================================
1. remove %nn strings from dups of announces and spots
2. remove check for ssids on PC41s
Display all the bad node callsigns in the system, see SET/BADNODE
for more information.
-=== 0^SHOW/CALL <callsign>^Show any callbook details on a callsign
-This command queries an international callbook server on the internet
-and returns any information available for that callsign.
-
=== 0^SHOW/DATE [<prefix>|<callsign>]^Show the local time
This is very nearly the same as SHOW/TIME, the only difference the format
of the date string if no arguments are given.
SH/QRA 52 41 N 0 58 E
+=== 0^SHOW/QRZ <callsign>^Show any callbook details on a callsign
+This command queries the QRZ callbook server on the internet
+and returns any information available for that callsign. This service
+is provided for users of this software by http://www.qrz.com
+
=== 0^SHOW/SATELLITE <name> [<hours> <interval>]^Show tracking data
Show the tracking data from your location to the satellite of your choice
from now on for the next few hours.
close CLLOCK;
}
-
use Msg;
use DXVars;
use DXDebug;
$fp = DXLog::new('debug', 'dat', 'd');
@today = Julian::unixtoj(time());
+my $nolines = 1;
+my @prev;
for my $arg (@ARGV) {
if ($arg =~ /^-/) {
$arg =~ s/^-//o;
push @list, $arg;
+ } elsif ($arg =~ /^\d+$/) {
+ $nolines = $arg;
} else {
$string = $arg;
last;
}
}
-die "usage: grepdbg [[-nnn] ..] <regexp>\n" unless $string;
+die "usage: grepdbg [nn] [[-nnn] ..] <regexp>\n" unless $string;
push @list, "0" unless @list;
for my $entry (@list) {
while (<$fh>) {
my $line = $_;
chomp $line;
+ push @prev, $line;
+ shift @prev while @prev > $nolines;
if ($line =~ m{$string}io) {
- my @line = split '\^', $line;
- my $t = shift @line;
- print atime($t), ' ', join('^', @line), "\n";
+ for (@prev) {
+ my @line = split '\^';
+ my $t = shift @line;
+ print atime($t), ' ', join('^', @line), "\n";
+ }
}
}
$fp->close();
my $fp = DXLog::new('debug', 'dat', 'd');
my @today = Julian::unixtoj(time());
my $fh = $fp->open(@today) or die $!;
+my $nolines = shift if $ARGV[0] =~ /^\d+$/ || 1;
my $exp = join '|', @ARGV;
+my @prev;
# seek to end of file
$fh->seek(0, 2);
my $line = <$fh>;
if ($line) {
if ($exp) {
- printit($line) if $line =~ m{(?:$exp)}oi;
+ push @prev, $line;
+ shift @prev while @prev > $nolines;
+ printit(@prev) if $line =~ m{(?:$exp)}oi;
} else {
- printit($line);
- }
+ printit($line);
+ }
} else {
sleep(1);
-
+
# check that the debug hasn't rolled over to next day
# open it if it has
my @now = Julian::unixtoj(time());
sub printit
{
- my $line = shift;
- 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);
+ while (@_) {
+ my $line = shift;
+ 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);
+ }
}
exit(0);