From 8b68c016b1907375bfad28d762daa49df7b93f5d Mon Sep 17 00:00:00 2001 From: djk Date: Sat, 1 Jan 2000 14:47:20 +0000 Subject: [PATCH] renamed gdx.pl as showdx --- Changes | 1 + perl/{gdx.pl => showdx} | 31 +++++++++++++++++++++---------- 2 files changed, 22 insertions(+), 10 deletions(-) rename perl/{gdx.pl => showdx} (54%) diff --git a/Changes b/Changes index cae5201f..eeb6a553 100644 --- a/Changes +++ b/Changes @@ -4,6 +4,7 @@ as I do!). 2. updated gdx.pl so that external programs can do a sh/dx just as a normal user can. On reflection this could be used as a model for all sorts of "external" interface routines. +3. renamed gdx.pl as showdx. 11Dec99======================================================================= 1. added missing pc48 so that it calls the DXDb::process routine 10Dec99======================================================================= diff --git a/perl/gdx.pl b/perl/showdx similarity index 54% rename from perl/gdx.pl rename to perl/showdx index f88761ab..9af8f41b 100755 --- a/perl/gdx.pl +++ b/perl/showdx @@ -1,6 +1,10 @@ #!/usr/bin/perl # -# grep for expressions in various fields of the dx file +# Implement an external "show/dx" command +# +# Copyright (c) 1998-2000 Dirk Koopman G1TLH +# +# $Id$ # # search local then perl directories @@ -28,15 +32,22 @@ STDOUT->autoflush(1); Spot::init(); Bands::load(); -for (;;) { - print "expr: "; - $expr = ; - last if $expr =~ /^q/i; +$expr = join ' ', @ARGV if @ARGV; - chomp $expr; - - my @out = map {"$_\n"} &$dxproc({priv=>0,call=>'GDX'}, $expr); - shift @out; # remove return code - print @out; +for (;;) { + if ($expr) { + $myexpr = $expr; + } else { + print "show/dx: "; + $myexpr = ; + last unless defined $myexpr; + chomp $myexpr; + last if $myexpr =~ /^q$/i; + } + my @out = map {"$_\n"} &$dxproc({priv=>0,call=>'GDX'}, $myexpr); + shift @out; # remove return code + print @out; + last if $expr; } +exit(0); -- 2.34.1