TIP: Click on subject to list as thread! ANSI
echo: os2user-l
to: All
from: `Julian Thomas`
date: 2004-03-20 12:29:38
subject: Re: One for the TCP/IP wizards

In , on 03/21/04 
   at 12:02 AM, Mike O'Connor  typed:

>>http://hobbes.nmsu.edu/pub/os2/apps/internet/util/dig20.zip 
>>  
>>

>Hi Julian,
>Thanks for the URL. I hadn't yet gone Googling. :-)   


I didn't google that one - just went directly to Hobbes (my first stop for
OS2 stuff).

I usually call it from digger.cmd (you need to edit to plug in your own
dns server):

It is large because it uses Steven Levine's structure for Rexx progs.

/* digger.cmd - call dig with dns server and all */


signal on FAILURE name Error
signal on NOTREADY name Error
signal on NOVALUE name Error
signal on SYNTAX name Error


call Initialize

global.Version = '0.1'

Main:
dns='{at}208.20.35.2'

parse arg who type x .

if left(who,1)='{at}' then do
   dns = who
   who = type
   type = x
   end

if who='' then do
   say 'usage is digger [{at}server] domain [type]'
   say 'Default type=any.  default is FLTG nameserver'
   say 'use man dig for more options.'
   exit
   end


if type='' then type='any'

'{at}dig'  dns who type '|less'


exit
/* end main */

/*=== Initialize() Intialize globals ===*/

Initialize: procedure expose Global.

  call LoadFuncs

  /* Set: global.CmdName - script name without path and extension
	  global.TmpDir - default = TMP or TEMP, trailing \ forced
  */

  parse source . . sz
  sz = filespec('N', sz)
  c = lastpos('.', sz)
  if c > 1 then
    sz = left(sz, c - 1)		/* Chop extension */
  global.CmdName = ToLower(sz)

  sz = value('TMP',,'OS2ENVIRONMENT')
  if sz \= '' & right(sz, 1) \= ':' & right(sz, 1) \= '\' then
    sz = sz'\'				/* Stuff backslash */
  global.TmpDir = sz

  return

/* end Initialize */


/*==========================================================================
*/ /*=== Standard functions - Delete unused - Move modified above this
mark === */
/*==========================================================================
*/

/*=== Error() Trap ERROR, FAILURE etc. - returns szCondition or exits
===*/

Error:
  xrc=rc
  say
  parse source . . szThisCmd
  say condition('C') 'signaled at' SIGL 'of' szThisCmd
  say condition('D')
  if datatype(xrc)='NUM' then say 'Error' xrc errortext(xrc)
  say 'Source =' sourceline(SIGL)
  call SysSleep 2
  if condition('I') \== 'CALL' then do
    say 'Exiting'
    call SysSleep 2
    exit 255
  end
  szCondition = condition('C')
  say 'Returning'
  return

/* end Error */

/*=== Fatal(message) Report fatal error and exit ===*/

Fatal:
  parse arg szMsg
  say
  say global.CmdName':' szMsg
  call Beep 200, 300
  exit 254

/* end Fatal */



/*=== LoadFuncs() Load fuctions ===*/

LoadFuncs:

  /* Add all Rexx functions */
  if RxFuncQuery('SysLoadFuncs') then do
    call RxFuncAdd 'SysLoadFuncs', 'REXXUTIL', 'SysLoadFuncs'
    if RESULT then
      call Fatal 'Cannot load SysLoadFuncs'
    call SysLoadFuncs
  end /* end do */

  return

/* end LoadFuncs */

/*=== ToLower(sz) Convert to lower case ===*/

ToLower: procedure

  parse arg sz
  return translate(sz, xrange('a', 'z'), xrange('A', 'Z'))

/* end ToLower */

/* The end */

 
-- 
 Julian Thomas:   jt{at}jt-mj.net    http://jt-mj.net
 In the beautiful Finger Lakes Wine Country of New York State!
 Boardmember of POSSI.org - Phoenix OS/2 Society, Inc  http://www.possi.org
 -- --
 Bills travel through the mail at twice the speed of checks.





 
Yahoo! Groups Links

 To visit your group on the web, go to:
     http://groups.yahoo.com/group/os2user/

 To unsubscribe from this group, send an email to:
     os2user-unsubscribe{at}yahoogroups.com

 Your use of Yahoo! Groups is subject to:
     http://docs.yahoo.com/info/terms/
 


---
* Origin: Waldo's Place USA Internet Gateway (1:3634/1000)
SEEN-BY: 633/267 270
@PATH: 3634/1000 12 106/2000 633/267

SOURCE: echomail via fidonet.ozzmosis.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.