home *** CD-ROM | disk | FTP | other *** search
/ Hacker Chronicles 1 / HACKER1.ISO / phrk2 / phrack19.2 < prev    next >
Text File  |  1992-09-26  |  24KB  |  648 lines

  1.  
  2.                                ==Phrack Inc.==
  3.                      Volume Two, Issue 19, Phile #2 of 8
  4.  
  5.                          DCL Utilities for the VMS Hacker
  6.                          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  7.                                        By
  8.                                    The Mentor
  9.  
  10.                           Special thanks to Silver Spy for 
  11.                       turning me onto DCL in the first place!
  12. -----------------------------------------------------------------------------
  13.  
  14.      Anyone who spends time hacking on VAXes (by hacking, I don't just mean
  15. trying to get in... I mean *doing* something once you're in!) notices that
  16. the DCL command language is extremely powerful.  I have put together a 
  17. selection of utilities that not only should prove helpful to the hacker, but
  18. serve as a good example of programming in DCL.  
  19.      Every attempt has been made to preserve unchanged the user-enviroment
  20. from the initialization of the file to the exit.  Any session-permanent
  21. changes are documented.
  22.  
  23.                           Brief Overview of DCL
  24.                           ~~~~~~~~~~~~~~~~~~~~~
  25.  
  26.      There are numerous files out there on DCL (the VMS help files are
  27. the best place to find information), so I'm not going to teach you how to
  28. program in it.  To use the following code, isolate the section of code you
  29. want in your favorite text editor, upload it into a file, and name the file
  30. <progname>.COM.  Anytime you see a file ending with .COM, you know it's a
  31. DCL file.  DCL files are executed by issuing the command
  32.                        $@FILENAME
  33. or, in the case of a file you want to run as a separate process,
  34.                        $SPAWN/NOWAIT @FILENAME
  35.  
  36.                             Table of Contents
  37.                             ~~~~~~~~~~~~~~~~~
  38.  
  39.      1. CD.DOC     :  This is the documentation for CD.COM (and the only
  40.                       documentation file in the bunch.
  41.      2. CD.COM     :  A change directory utility, much like the PC command
  42.                       CD, except more powerful.  $SET DEFAULT is a pain in
  43.                       the ass!
  44.      3. HUNT.COM   :  Searches a specified node for a given user.  Usefull
  45.                       for alerting you to the presence of a sysop.
  46.      4. ALARM.COM  :  An alarm clock.  If they check the logs at 8 a.m., you
  47.                       probably want to be off before then.
  48.      5. CGO.COM    :  Included because it's short.  Allows you to compile,
  49.                       link, and run a C program with a one-line command.
  50.  
  51.  
  52.      I have about 300 more pages of COM files.  If you need anything, drop
  53. me a line.  I'll try and help out.  I can be found on Forgotten Realm, or you
  54. can call a non-hacker (local to me) IBM game board if it's an urgent message
  55. (The Bastille-- 512/353-0590  300/1200  24 hrs.  It's not the best
  56. hacker board in the world, but my mail arrives daily...)
  57.  
  58.      Also, if programming of this type interests you, let me know!  I'm 
  59. considering putting up a board for the discussion of programming (compilers,
  60. AI/Expert Systems, Op Systems, etc...)  If I get enough positive response,
  61. I'll go with it.  Leave mail on the aforementioned systems.
  62.  
  63.                                                 The Mentor
  64.  
  65.  
  66.  
  67.  
  68.        CD.COM   Version 5.0   VMS Change Directory Command
  69.                   
  70.  
  71.        Sub-directories are a nice feature on many computers, but
  72.        they're not always easy to take advantage of.  The VMS
  73.        commands to access sub-directories are a little obscure,
  74.        even to PC programmers who are used to using directories.
  75.  
  76.        The solution?  CD.COM, a change directory command that works
  77.        almost the same as the PC-DOS CD and PROMPT commands:
  78.  
  79.           CD              - Display your home directory, current
  80.                             directory, and node name.  (Similar to, but
  81.                             better than the VMS SHOW DEFAULT command.)
  82.  
  83.           CD dir_name     - Move you to the [dir_name] directory.
  84.           CD [dir_name]     (Same as the SET DEFAULT [dir_name] command.)
  85.  
  86.           CD .sub_name    - Move you to the [.sub_name] subdirectory.
  87.           CD [.sub_name]    (Same as the SET DEFAULT [.sub_name] command.)
  88.  
  89.           CD \            - Move you to your home (root) directory, which
  90.           CD HOME           is the directory you are in when you login.
  91.           CD SYS$LOGIN      (Same as the SET DEFAULT SYS$LOGIN command.)
  92.  
  93.           CD ..           - Move you to the directory above your
  94.           CD [-]            current directory. (Same as the VMS
  95.                             SET DEFAULT [-] command.)
  96.  
  97.           CD ..sub_name   - Move you "sideways" from one subdirectory
  98.           CD [-.sub_name]   to another subdirectory. (Same as the
  99.                             SET DEFAULT [-.sub_name] command.)
  100.  
  101.           CD *            - Select a subdirectory to move to, from a
  102.                             list of subdirectories.
  103.  
  104.           CD .            - Reset the current directory.
  105.  
  106.           CD ?            - Display instructions for using CD.
  107.  
  108.        The VMS SET DEFAULT command has a flaw: you can change
  109.        directories to a directory that doesn't exist.  CD handles this
  110.        more elegantly; you're left in the same directory you were in
  111.        before, and this message appears:
  112.  
  113.             [dir_name] Directory does not exist!
  114.  
  115.        PC-DOS lets you display the current directory as part of the
  116.        prompt.  (If you haven't seen this feature, try the PC-DOS
  117.        command PROMPT $P$G.)  CD.COM will change the prompt for you
  118.        each time you change directories if you include this line in
  119.        your LOGIN.COM file:
  120.  
  121.           DEFINE SYS$PROMPT "ON"
  122.  
  123.        Without this line, your prompt is not changed from what you
  124.        have it set as.  Instead, your home (root) directory name,
  125.        current directory name, and node name are displayed whenever
  126.        you issue the CD command.
  127.  
  128.        Since VMS allows prompts to contain no more than 32 characters,
  129.        if you change to a subdirectory that would make your prompt too
  130.        long, CD automatically leaves off some of the higher level
  131.        sub-directories to keep your prompt short, and displays a "*"
  132.        as one of the prompt characters.
  133.  
  134.        CD lets you use directory names defined with with the DEFINE
  135.        command.  For example, if you're in one of Dr. Smiths' CS3358
  136.        classes, you might want to define his CS3358 assignments
  137.        directory like this:
  138.  
  139.           DEFINE SMITH "DISK$CS:[CS.SMITH.3358]"
  140.  
  141.        Then, CD SMITH would move you to this directory.  Try it!
  142.        Also, some directories are already defined by the system.
  143.        The SHOW LOGICAL command will give you clues to some of these
  144.        system directories, if you want to go exploring.  CD also
  145.        supports the use of symbols for directory names.
  146.  
  147.        Like with PC-DOS, VMS directories and sub-directories are tree
  148.        structured.  The system root directory for your disk has the
  149.        name [000000], and in it are the names of all the sub-directories
  150.        for your disk.  The directories for an imaginary user, CS335825305,
  151.        would be located like this:
  152.  
  153.   System Root Directory:
  154.                                  [000000]
  155.                                .   .   .   .
  156.   CS3358 Directories:    .        .     .        .
  157.                    .             .      *.             .
  158.        ... [CS3358251]   [CS3358252]   [CS3358253]   [CS3358254] ...
  159.                                       .   .      .
  160.   CS3358253 Directories:        .         .           .
  161.                           .              *.               .
  162.        ... [CS3358253.04HOPE]   [CS3358253.05JONES]   [CS3358253.06KEY] ...
  163.                                        .    .
  164.   CS335825305 Directories:            .      .
  165.                                     *.       *.
  166.                  [CS3358253.05JONES.MAIL]  [CS3358253.05JONES.BULL]
  167.  
  168.  
  169.        If you're not using sub-directories, but want to, you can
  170.        create them with the CREATE command:
  171.  
  172.            CREATE/DIR  [.sub_name]
  173.  
  174.        VMS allows directories to be seven or eight levels deep, but
  175.        one or two levels is enough for most users.
  176.  
  177.        VMS also allows the symbols < and > to be used instead of
  178.        [ and ], to specify directory names. CD fully supports this.
  179.  
  180.                            Code for CD.COM
  181.                            ~~~~~~~~~~~~~~~
  182.  
  183. $! CD.COM v6.09
  184. $! The Ultimate Change Directory Command.
  185. $!
  186. $  hdir     = f$trnlnm("SYS$LOGIN")                 ! Home Directory
  187. $  ndir     = f$edit(p1,"UPCASE")                   ! New  Directory
  188. $  odir     = f$environment("DEFAULT")              ! Old  Directory
  189. $  prompton = (f$edit(f$trnlnm("SYS$PROMPT"),"UPCASE") .eqs. "ON")
  190. $!
  191. $  if (ndir .eqs. "")           then goto DISPLAY   ! No Dir
  192. $  if (ndir .eqs. "*")          then goto DIRSEARCH ! Search for Dirs
  193. $  if (ndir .eqs. "?")          then goto HELP      ! Instructions
  194. $!
  195. $  PARSE:
  196. $  length   = f$length(ndir)                        ! Fix up ndir
  197. $  if (f$location("@",ndir) .eq. 0) .or. -
  198.       (f$location("$",ndir) .eq. 0) then ndir = f$extract(1, length - 1, ndir)
  199. $  right    = f$location("]",ndir) + 1
  200. $  if (right .gt. length) then right = f$location(">", ndir)
  201. $  if (right .le. length) then ndir  = f$extract(0, right, ndir)
  202. $!
  203. $  if (f$trnlnm(ndir) .eqs. "") then goto CASESYM   ! Not Logical Name
  204. $     ndir   = f$trnlnm(ndir)                       ! Logical Name
  205. $     goto PARSE
  206. $!
  207. $  CASESYM:
  208. $  if ("''&ndir'" .eqs. "")     then goto CASE0     ! Not Symbol
  209. $     ndir = 'ndir'                                 ! Symbol
  210. $     goto PARSE
  211. $!
  212. $  CASE0:
  213. $  len_ndir = f$length(ndir)                        ! Regular Dir
  214. $  if (f$location("[", ndir) .lt. len_ndir) .or. -
  215.       (f$location("<", ndir) .lt. len_ndir) then goto SETDIR
  216. $!
  217. $  CASE1:                                           ! Home Dir
  218. $  if ((ndir .nes. "HOME") .and. (ndir .nes. "\")) then goto CASE2
  219. $     ndir = hdir
  220. $     goto SETDIR
  221. $!
  222. $  CASE2:                                           ! . .. .dir
  223. $  if (f$location(".", ndir) .nes. 0) then goto CASE3
  224. $     if (ndir .eqs. "..") then ndir = "-"
  225. $     if (f$extract(0, 2, ndir) .eqs. "..") -
  226.          then ndir = "-" + f$extract(1, len_ndir - 1, ndir)
  227. $     ndir = "[" + ndir + "]"
  228. $     if (ndir .eqs. "[.]") then ndir = odir
  229. $     goto SETDIR
  230. $!
  231. $  CASE3:                                           ! :
  232. $  if (f$location(":", ndir) .ge. len_ndir) then goto CASE4
  233. $     left    = f$location(":", ndir) + 1
  234. $     symbol  = f$extract(left, 1, ndir)
  235. $     if (symbol .eqs. ":")  then goto CASE3B       ! :: Node
  236. $     if ((symbol .eqs. "[") .or. (symbol .eqs. "<")) then goto SETDIR
  237. $        ndir = f$extract(0, left, ndir) + "[" -
  238.               + f$extract(left, len_ndir - left+1, ndir) + "]"
  239. $     goto SETDIR
  240. $!
  241. $  CASE3B:                                          ! NODE::nothing
  242. $  if (f$length(ndir)-1 .gt. left) then goto CASE3C
  243. $     ndir = ndir + "[000000]"
  244. $     goto SETDIR
  245. $!
  246. $  CASE3C:                                          ! NODE::directory
  247. $  if ((f$location("[", ndir) - f$location("<", ndir)) .ne. 0) -
  248.       then goto SETDIR
  249. $
  250. $     ndir = f$parse(ndir,,,"NODE") + "[" + f$parse(ndir,,,"NAME") + "]"
  251. $     goto SETDIR
  252. $!
  253. $  CASE4:                                           ! dir
  254. $  ndir = "[" + ndir + "]"
  255. $!
  256. $  SETDIR:
  257. $  set default 'ndir'
  258. $  if (f$parse("") .eqs. "") then goto DIRERROR
  259. $!
  260. $  DISPLAY:
  261. $  if ((ndir .nes. "") .and. prompton) then goto NODISPLAY
  262. $     hnode = f$getsyi("NODENAME")
  263. $     cnode = f$parse(f$trnlnm("SYS$DISK"),,,"NODE") - "::"
  264. $     if (cnode .eqs. "") then cnode = hnode
  265. $     cdir  = f$environment("DEFAULT")
  266. $     write sys$output " "
  267. $     write sys$output "          Home Node: ", hnode
  268. $     write sys$output "     Home Directory: ", hdir
  269. $     if (cdir .eqs. hdir) .and. (cnode .eqs. hnode) then goto DISPSKIP
  270. $     write sys$output "       Current Node: ", cnode
  271. $     write sys$output "  Current Directory: ", cdir
  272. $  DISPSKIP:
  273. $     write sys$output " "
  274. $!
  275. $  NODISPLAY:
  276. $  ndir = f$environment("DEFAULT")
  277. $  if .not. prompton then goto END
  278. $!
  279. $  if (f$length(ndir) .ge. 32) then goto TOOLONG
  280. $!
  281. $  SETPROMPT:
  282. $  set prompt = 'ndir'" "
  283. $!
  284. $  END:
  285. $  exit
  286. $!
  287. $  DIRERROR:
  288. $  write sys$output " "
  289. $  wr%QeMztput "          ", ndir, " Directory does not exist!"
  290. $  write sys$output " "
  291. $  set default 'odir'
  292. $  ndir = odir
  293. $  goto NODISPLAY
  294. $!
  295. $! Prompt Problems------------------------------------------------------------
  296. $!
  297. $  TOOLONG:
  298. $! Prompt is too long. Get rid of everything to the left of [ or <. If that
  299. $! doesn't work, get rid of a subdirectory at a time.  As a last resort,
  300. $! set the prompt back to $.
  301. $!
  302. $  left     = f$location("[", ndir)
  303. $  len_ndir = f$length(ndir)
  304. $  if (left .ge. len_ndir) then left = f$location("<",ndir)
  305. $  if (left .gt. 0) .and. (left .lt. len_ndir) -
  306.       then ndir = f$extract(left, len_ndir - left, ndir)
  307. $!
  308. $  STILLTOOLONG:
  309. $    if (f$length(ndir) .lt. 32) then goto SETPROMPT
  310. $    left     = f$location(".", ndir) + 1
  311. $    len_ndir = f$length(ndir)
  312. $    if left .ge. len_ndir then ndir = "$ "
  313. $    if left .ne. len_ndir -
  314.         then ndir = "[*" + f$extract(left, len_ndir - left, ndir)
  315. $    goto STILLTOOLONG
  316. $!
  317. $! Wildcard Directory--------------------------------------------------------
  318. $!
  319. $  DIRSEARCH:
  320. $  error_message = f$environment("MESSAGE")
  321. $  on control_y then goto DIREND
  322. $  on control_c then goto DIREND
  323. $  set message/nosev/nofac/noid/notext
  324. $  write sys$output " "
  325. $  dispct = 1
  326. $  dirct  = 0
  327. $  pauseflag = 1
  328. $!
  329. $  DIRLOOP:
  330. $    userfile = f$search("*.dir")
  331. $    if (userfile .eqs. "") .and. (dirct .ne. 0) then goto DIRMENU
  332. $    if (userfile .eqs. "") then goto DIRNONE
  333. $    dispct = dispct + 1
  334. $    dirct  = dirct  + 1
  335. $    on severe then $ userprot = "No Priv"
  336. $    userprot = f$file_attributes(userfile,"PRO")
  337. $    if userprot .nes. "No Priv" then userprot = " "
  338. $    userfile'dirct' = "[." + IM!*Mfile,,,"NAME") + "]"
  339. $    userprot'dirct' = userprot
  340. $    lengthflag = (f$length(userfile'dirct') .gt. 18)
  341. $    if lengthflag then write sys$output -
  342.         f$fao("  !3SL   !34AS  ", dirct, userfile'dirct'), userprot'dirct'
  343. $    if (.not. lengthflag) then write sys$output -
  344.         f$fao("  !3SL   !20AS  ", dirct, userfile'dirct'), userprot'dirct'
  345. $    if (dispct .lt. 8) then goto DIRLOOP
  346. $    dirct  = dirct  + 1
  347. $    userfile'dirct' = ""
  348. $    dirct  = dirct  + 1
  349. $    userfile'dirct' = ""
  350. $    if pauseflag then goto DIRMENU
  351. $    dispct = 0
  352. $    goto DIRLOOP
  353. $!
  354. $  DIRMENU:
  355. $  write sys$output " "
  356. $  if (userfile .eqs. "") then goto DIRMENU2
  357. $     write sys$output "    M   More subdirectories"
  358. $  if pauseflag then -
  359. $     write sys$output "    N   More subdirectories/No pause"
  360. $!
  361. $  DIRMENU2:
  362. $     write sys$output "    R   Re-Display subdirectories"
  363. $     write sys$output "    Q   Quit (default)"
  364. $
  365. $  DIRINQUIRE:
  366. $  write sys$output " "
  367. $  inquire dirchoice "  Select One"
  368. $  write sys$output " "
  369. $!
  370. $  if (dirchoice .gt. 0)    .and. -
  371.       (dirchoice .le. dirct) then goto DIRCASEDIGIT
  372. $  dirchoice = f$edit(dirchoice,"UPCASE")
  373. $  if (dirchoice .eqs. "")  .or. -
  374.       (dirchoice .eqs. "Q")  then goto DIRCASEBLANK
  375. $  if (dirchoice .eqs. "M") .or. -
  376.       (dirchoice .eqs. "N")  then goto DIRCASEMORE
  377. $  if (dirchoice .eqs. "R")  then goto DIRCASERED
  378. $!
  379. $  DIRCASERROR:
  380. $  if (dirct .eq. 1)   then write sys$output -
  381.       "  Select 1 to change to the ", userfile1, " subdirectory. "
  382. $  revdirct = dirct
  383. $  if (dispct .eq. 8) then revdirct = revdirct - 2
  384. $  if (dirct .gt. 1)   then write sys$output -
  385.       "  Valid subdirectory selections are 1 through ", revdirct, " (Octal)."
  386. $  goto DIRINQUIRE
  387. $!
  388. $  DIRCASEDIGIT:
  389. $  if (userfile'dirchoice' .eqs. "") then goto DIRCASERROR
  390. $  ndir = userfile'dirchoice'
  391. $  goto DIREND
  392. $!
  393. $  DIRCASEBLANK:
  394. $  write sys$output "  Subdirectory not changed."
  395. $  write sys$output " "
  396. $  goto DIREND
  397. $!
  398. $  DIRCASEMORE:
  399. $  dispct = 0
  400. $  if (dirchoice .eqs. "N") then pauseflag = 0
  401. $  if (userfile .nes. "")   then goto DIRLOOP
  402. $  write sys$output "  No more subdirectories to display."
  403. $  goto DIRINQUIRE
  404. $!
  405. $  DIRCASERED:
  406. $  dispct = 1
  407. $  DISPLOOP:
  408. $     if (userfile'dispct' .eqs "") then goto DISPDONT
  409. $     lengthflag = (f$length(userfile'dispct') .gt. 18)
  410. $     if lengthflag then write sys$output -
  411.          f$fao("  !3SL   !34AS  ", dispct, userfile'dispct'), userprot'dispct'
  412. $     if (.not. lengthflag) then write sys$output -
  413.          f$fao("  !3SL   !20AS  ", dispct, userfile'dispct'), userprot'dispct'
  414. $     DISPDONT:
  415. $     dispct = dispct + 1
  416. $     if (dispct .le. dirct) then goto DISPLOOP
  417. $  goto DIRMENU
  418. $!
  419. $  DIRNONE:
  420. $  write sys$output "  No subdirectories to choose, or no directory privileges."
  421. $  write sys$output " "
  422. $  goto DIREND
  423. $!
  424. $  DIREND:
  425. $  set message 'error_message'
  426. $  on control_y then exit
  427. $  on control_c then exit
  428. $  if (ndir .eqs. "*") then goto DISPLAY
  429. $  goto PARSE
  430. $!
  431. $!-Help-----------------------------------------------------------------------
  432. $!
  433. $  HELP:
  434. $  type sys$input
  435.  
  436.               CD.COM  Version 6  VMS Change Directory Command
  437.  
  438.                        Usage:  CD command/directory
  439.  
  440. CD         Display home directory,       CD ..       Change directory to the
  441.            current directory, node.      CZU)   $H dir above current dir.
  442.  
  443. CD \       Change directory to your      CD ..sub    Change directory to a
  444. CD HOME    SYS$LOGIN directory.          CD [-.sub]  "sideways" subdirectory.
  445.  
  446. CD dir     Change directory to the       CD *        Display/select the
  447. CD [dir]   [dir] directory.                          available subdirectories.
  448.  
  449. CD .sub    Change directory to the       CD .        Reset current directory.
  450. CD [.sub]  [.sub] subdirectory.          CD ?        Display CD instructions.
  451.  
  452.      CD :== @SYS$LOGIN:CD.COM                 DEFINE SYS$PROMPT "ON"
  453.      To make CD available from                To have the VMS $ prompt
  454.      any directory you change to.             display the current directory.
  455.  
  456.                               By The Mentor
  457. $  goto END
  458.  
  459.  
  460.                             Code for HUNT.COM
  461.                             ~~~~~~~~~~~~~~~~~
  462.  
  463.  
  464. $ ! HUNT.COM
  465. $ ! By The Mentor
  466. $ ! Updated by: The Mad Mexican
  467. $ ! Usage: SPAWN/NOWAIT @HUNT
  468. $ ! 
  469. $ !Searches SHOW USER output for a specified user,  strobes at given
  470. $ !intervals considering the severity of the hunt at which time output
  471. $ !is generated and process terminates. If user loggs in then output
  472. $ !is generated and process terminates. May check both nodes if a set
  473. $ !host is called.  Also supports a file with the names to be hunted for.
  474. $ !
  475. $ !  *** NOTE ***   This is set up for a two-node system with NYSSA
  476. $ !                 being the default node and TEGAN being the alternate
  477. $ !                 node (Circuit Breaker and some others will recognize
  478. $ !                 the nodes as my 'home' ones.)  You will need to 
  479. $ !                 slightly modify the code to reflect the nodename(s)
  480. $ !                 of whatever system you are using...
  481. $ !
  482. $ ! 
  483. $ !
  484. $ say="write sys$output"
  485. $ on control then goto door
  486. $ monitored_node = "''NODE'"
  487. $ say "Monitoring node ''monitored_node'.  <HIT RETURN>"
  488. $ severity_of_hunt:
  489. $ inquire selection "Severity of HUNT, 1 being the most urgent: 1-2-3"
  490. $ if selection.ge.2 then goto selection_2
  491. $ delay="wait 00:00:20"
  492. $ loop_count=40
  493. $ goto begin_process
  494. $ selection_2:
  495. $ if selection.eq.3 then goto selection_3
  496. $ delay="wait 00:01:00"
  497. $ loop_count=8
  498. $ goto begin_process
  499. $ if selection.gt.3 then goto severity_of_hunt
  500. $ delay="wait 00:02:30"
  501. $ loop_count=20
  502. $ begin_process:
  503. $ if monitored_node.eqs."TEGAN" then goto search_file_tegan
  504. $ if f$search("nyssa.dat9") .nes. "" then goto file_exist
  505. $ goto continue
  506. $ search_file_tegan:
  507. $ if f$search("tegan.dat9") .nes. "" then goto file_exist
  508. $ continue:
  509. $ say "hit <RETURN>"
  510. $ inquire/nopunctuate choice9 "Who are we hunting for? "
  511. $ if choice9 .eqs. "" then exit
  512. $ count = 0
  513. $ bell_sound[0,8]=%X07
  514. $ top:
  515. $ sho user/output='monitored_node'.dat9
  516. $ purge 'monitored_node'.dat9
  517. $ set message/nofac/noid/notext/nosev
  518. $ search 'monitored_node'.dat9 'choice9'
  519. $ a=$severity
  520. $ if a .eqs. "1" then goto found_user
  521. $ set message 'temp_msg9'
  522. $ count = count + 1
  523. $ if count .ge. 'loop_count' then goto give_up
  524. $ delay
  525. $ goto top
  526. $ file_exist:
  527. $ say "ERROR - Could not create temporary data file."
  528. $ say "Please delete or rename ''NODE'.DAT9"
  529. $ exit
  530. $ found_user:
  531. $ say bell_sound
  532. $ say "''choice9' is now online on node ''monitored_node'."
  533. $ say bell_sound
  534. $ goto door
  535. $ give_up:
  536. $ say " "
  537. $ say "''choice9' has not yet logged in on ''monitored_node'."
  538. $ door:
  539. $ say bell_sound
  540. $ say "HUNT routine has terminated on node ''monitored_node'."
  541. $ delete/noconfirm/nolog 'monitored_node'.dat9;*
  542. $ set message 'temp_msg9'
  543. $ exit
  544.  
  545.                         Code for ALARM.COM
  546.                         ~~~~~~~~~~~~~~~~~~
  547.  
  548. $ ! ALARM.COM
  549. $ ! By The Mentor
  550. $ ! Usage: SPAWN/NOWAIT @ALARM
  551. $ ! Strobes f$time() every 5 seconds until specified time
  552. $ ! is met at which time output is generated and process terminates.
  553. $ CLR = " "
  554. $ count = 0
  555. $ PID         = F$PID(CONTEXT)
  556. $ TERMINAL    = F$GETJPI(''PID',"TERMINAL")
  557. $ DEVICE      = F$GETDVI(TERMINAL,"DEVTYPE")
  558. $ IF DEVICE .EQS. 110 THEN CLR = "[H[2J"  ! VT220
  559. $ IF DEVICE .EQS.  98 THEN CLR = "[H[2J"  ! VT102
  560. $ IF DEVICE .EQS.  96 THEN CLR = "[H[2J"  ! VT100
  561. $ IF DEVICE .EQS.  64 THEN CLR = "HJ"     ! VT52
  562. $ CLS = "WRITE SYS$OUTPUT CLR"
  563. $ DATE     = F$CVTIME(F$TIME())
  564. $ NODE     = F$GETSYI("NODENAME")
  565. $ bell[0,8]=%X07
  566. $ ON CONTROL THEN GOTO DOOR
  567. $ say = "write sys$output"
  568. $ say f$cvtime(,,"TIME")
  569. $ say " "
  570. $ say "Hit (RETURN)"
  571. $ say " "
  572. $ inquire/nopunctuate alarm "What time shall I ring you - "
  573. $ a_hour = f$element(0,":",alarm)
  574. $ a_minute = f$element(1,":",alarm)
  575. $ a_second = f$element(2,":",alarm)
  576. $ time_check:
  577. $ hour = f$element(0,":",f$cvtime(,,"TIME"))
  578. $ minute = f$element(1,":",f$cvtime(,,"TIME"))
  579. $ second = f$element(2,":",f$element(0,".",f$cvtime(,,"TIME")))
  580. $ if hour .ge. a_hour .and. minute .ge. a_minute .and. second .ge.
  581.   a_second then goto top
  582. $ if hour .ge. a_hour .and. minute .ge. a_minute then goto top
  583. $ wait 00:00:05
  584. $ goto time_check
  585. $ top:
  586. $ count = count + 1
  587. $ cls
  588. $ say " "
  589. $ say " "
  590. $ say " "
  591. $ say " "
  592. $ say " "
  593. $ say " "
  594. $ say " "
  595. $ say " "
  596. $ say " "e~
  597. $ say " "
  598. $ say "                              A L A R M   O N"
  599. $ say bell
  600. $ say "                                 ",f$element(0,".",f$cvtime(,,"TIME"))
  601. $ say " "
  602. $ say " "
  603. $ say " "
  604. $ say " "
  605. $ say " "
  606. $ say " "
  607. $ say " "
  608. $ say " "
  609. $ say " "
  610. $ wait 00:00:01.50
  611. $ if count .le. "6" then goto top
  612. $ door:
  613. $ say "ALARM OFF"
  614. $ say f$element(0,".",f$cvtime(,,"TIME"))
  615. $ say bell
  616. $ exit
  617.  
  618.  
  619.                        Code for CGO.COM
  620.                        ~~~~~~~~~~~~~~~~
  621.  
  622. $! CGO.COM
  623. $! By The Mentor
  624. $! One-Line compile/link/execute of C programs
  625. $! Usage: CGO :== @CGO.COM
  626. $!        CGO filename
  627. $!
  628. $if p1 .nes. "" then c_filename :== 'p1
  629. $ write sys$output "Compiling:"
  630. $ cc 'c_filename/list='c_filename.lst
  631. $ write sys$output "Linking:"
  632. $ link 'c_filename ,options_file/opt
  633. $ write sys$output "Running:"
  634. $ assign/user sys$command sys$input
  635. $ run 'c_filename
  636. $ exit
  637. ---------------------------------------------------------------------------
  638.  
  639.      Well, that's it.  I hope to be back in the next issue with some
  640. other programs.  And remember, any programmers out there, get in touch with
  641. me!
  642.                                    The Mentor
  643.                                 Thanksgiving 1987
  644. ===========================================================================
  645.  
  646. 
  647. Downloaded From P-80 International Information Systems 304-744-2253 12yrs+
  648.