home *** CD-ROM | disk | FTP | other *** search
/ CP/M / CPM_CDROM.iso / jsage / znode3 / tcj / tcj31upd.ws < prev    next >
Encoding:
Text File  |  1994-09-02  |  70.9 KB  |  1,489 lines

  1. [This is my column from The Computer Journal issue #31.  Since this articleì
  2. appeared, there have been extensive changes to the ARUNZ parameters.  Youì
  3. should use this article only as a guide to ways to apply ARUNZ.  For theì
  4. actual parameter expressions, please consult more recent documentation.  TCJì
  5. issue #33 has more up-to-date information, for example.  Jay Sage]
  6.  
  7.  
  8.      In my last column I said that I would discuss the progress I have beenì
  9. making with a new version of ZEX, the memory-based batch processor forì
  10. ZCPR3.  As frequently happens, however, another subject has come up andì
  11. preempted my attention.  I thought I would still get to ZEX later in thisì
  12. column, but the column is already by far the longest I have written.  So ZEXì
  13. and other matters planned for this time will have to wait.  For ZEX that isì
  14. not a bad thing, since I still have a lot of work to do on it, and by twoì
  15. months from now there should be considerably more progress.
  16.  
  17.  
  18.                          L'Affaire ARUNZ: J'Accuse
  19.  
  20.  
  21.      Not too long ago in a message on Z-Node Central, David McCord -- sysopì
  22. of the board and vice president of Echelon -- leveled a serious accusationì
  23. against me: that I have failed to provide proper documentation for my ARUNZì
  24. program.  I immediately decided to mount a vigorous defense against thisì
  25. scurrilous charge using all the means at my disposal, including the awesomeì
  26. power of the press (i.e., this column in The Computer Journal).
  27.  
  28.      Unfortunately, I find my defense hampered by a small technicality. ì
  29. True, many other people, faced with this very same impediment, haveì
  30. seemingly not been discouraged in the slightest from proceeding aggressivelyì
  31. with their defense.  However, I lack the character required to accomplishì
  32. this.  What is this technicality?  It is the fact that the charge is true.
  33.  
  34.  
  35.                               Excuses, Excuses
  36.  
  37.      An effective defense being out of the question, perhaps I can at leastì
  38. offer some lame excuses.
  39.  
  40.      First of all, it is not as true as it seems (if truth has degrees) thatì
  41. I have provided no documentation.  There is a help file, ARUNZ.HLP, that atì
  42. this very moment resides, as it has for years, in the HELP: directory on myì
  43. Z-Node RAS (remote access system).  Way back when ARUNZ was first madeì
  44. available to the user community, Bob Frazier was kind enough to prepare thisì
  45. help file for me, and it was included in the LBR file that I put up on my Z¡
  46. Node.  As a series of upgraded versions appeared, I began to omit the helpì
  47. file to avoid duplication and keep the new LBR files as small as possible. ì
  48. After a while, of course, the original library that did include the helpì
  49. file was removed from RASs.  Hence the impression that there is noì
  50. documentation.  Of course, by now that help file is rather obsolete anyway.
  51.  
  52.      If you are observant, you may have caught in the previous paragraph theì
  53. deliberate circumlocution "made available to the user community".  Why did Iì
  54. avoid the shorter and more natural expression "released"?  Because ARUNZ hasì
  55. still to this day (more than two years -- or is it three now -- after itsì
  56. first 'availability'), not actually been released.  Why?  Because I stillì
  57. have not finished it.  It is still in what I consider to be an incomplete,ì
  58. albeit quite usable, state.  A few more tweaks, a couple of additionalì
  59. features, a little cleaning up of the source code, a detailed DOC file . . .ì
  60. and it should be ready for a full, official release.
  61.  
  62.      ARUNZ is, regrettably, not my only program that persists in this state. ì
  63. It is simply the oldest one.  ZFILER and NZEX (new ZEX) suffer similarly. ì
  64. One might even say that this has become habitual with me.  What happens, ofì
  65. course, is that I don't find the time to code that one little crucialì
  66. additional feature before some other pressing issue diverts my attention. ì
  67. And by the time I do get back to it, I have thought of still another featureì
  68. that just has to be included before the program should be released.
  69.  
  70.      One solution would be not to make the programs available until they areì
  71. really complete.  There are two reasons why I have rejected this approach. ì
  72. First of all, though not complete to my satisfaction, the programs are inì
  73. quite usable condition.  It would be a shame if only I -- and perhaps aì
  74. small group of beta testers -- had been able to take advantage of the powerì
  75. of ARUNZ during these two or three years.
  76.  
  77.      The second problem with holding the programs back is that a lot of theì
  78. development occurs as the result of suggestions from other users, who oftenì
  79. have applications for the program that I never thought of and would neverì
  80. think of.  In a sense, I have chosen to enlist the aid of the entire userì
  81. community not only in the testing process but also in the programì
  82. development process.  And I think we have both benefited from thisì
  83. arrangement.
  84.  
  85.      The procedure I have developed for keeping track of these 'released'ì
  86. test versions is to append a letter to the normal version number.  As Iì
  87. compose this column, ARUNZ stands at version 0.9G, ZFILER stands at 1.0H,ì
  88. and NZEX stands at 1.0D.  When final versions are released, I will drop theì
  89. letter suffixes (except for NZEX, which will become ZEX version 4.0).
  90.  
  91.      The usability of the programs is probably the fundamental factor thatì
  92. keeps them in their incomplete state.  When one of them has some seriousì
  93. deficiency or or simply begs for an exciting new feature, it gets myì
  94. attention.  Once it is working reasonably well, however, I can ignore it andì
  95. devote my attention to other things that badly need fixing.  That is how Iì
  96. recently got started on NZEX.
  97.  
  98.  
  99.                                Making Amends
  100.  
  101.      Since excuses, no matter how excusing, do not solve a problem, I willì
  102. take advantage of this column to make amends for the poor state of the ARUNZì
  103. documentation by providing that documentation right here and now.  I hope itì
  104. will lead more people to make more complete and effective use of ARUNZ,ì
  105. which for me has been the single most powerful utility program on myì
  106. computers.
  107.  
  108.      To understand ARUNZ one must first understand the concept of the ZCPRì
  109. alias, and to understand aliases one must understand the multiple commandì
  110. line facility.  I have written some things about these subjects in earlierì
  111. columns, notably in issues #27 and #28, but I will start more or less fromì
  112. the beginning here.
  113.  
  114.  
  115.                            Multiple Command Lines
  116.  
  117.      One of the most powerful features of ZCPR3 is its ability to acceptì
  118. more than one command at a time and to process these commands sequentially. ì
  119. Quoting from my column in TCJ issue #27:  The multiple command capability ofì
  120. Z System ... is important not so much because it allows the user to enter aì
  121. whole sequence of commands manually but rather because it allows otherì
  122. programs to do so automatically.
  123.  
  124.      Obviously, in order to process multiple commands, the list of commandsì
  125. (at least the unexecuted ones) must be stored in some secure place whileì
  126. earlier ones are being carried out.  In the case of ZCPR3, there is aì
  127. dedicated area, called the multiple command line (MCL) buffer, located inì
  128. the operating system part of memory.  It stores the command line togetherì
  129. with a pointer (a memory address) to the next command to be executed.  Everyì
  130. time the ZCPR3 command processor returns to power, it uses the value of theì
  131. pointer to determine where to resume processing the command line.  Only whenì
  132. the end of the command line is reached does the command processor seek newì
  133. command line input.
  134.  
  135.      Storing multiple commands in memory is not the only possibility. ì
  136. Another secure place to keep them is in a disk file.  This is in some waysì
  137. what the SUBMIT facility does using the file $$$.SUB.  The main drawback toì
  138. this approach is the speed penalty associated with the disk accessesì
  139. required to write and read this file.  There is also always the possibilityì
  140. of running out of room on the disk or of the diskette with the $$$.SUB fileì
  141. being removed from the drive.  Using a memory buffer is faster and moreì
  142. reliable.
  143.  
  144.      Digital Research's most advanced version of CP/M, called CP/M-Plus,ì
  145. also provides for multiple command line entry, but it does it in a ratherì
  146. different, and I think less powerful, way.  When a multiple command line isì
  147. entered by the user, the system builds what is called a resident systemì
  148. extension (RSX), a special block of code that extends the operating systemì
  149. below its normal lower limit.  This RSX holds any pending commands.  Butì
  150. since it is not always present and is not at a fixed, known location inì
  151. memory, there is no straightforward way for programs to manipulate multipleì
  152. command lines.  On the other hand, this method does provide a bigger TPAì
  153. when only single commands are entered.
  154.  
  155.      In a ZCPR3 system, the MCL has a fixed size and is in a fixed location. ì
  156. Moreover, a ZCPR3 program can find out where the MCL is located by lookingì
  157. up the information about it in the ZCPR3 environment descriptor (ENV),ì
  158. another block of operating-system memory containing a rather complete indexì
  159. to the features of the particular ZCPR3 system.  The location of the ENV isì
  160. the one key fact that is conveyed to all ZCPR3 programs.  Prior to ZCPRì
  161. version 3.3, the address of the ENV had to be installed into each programì
  162. manually by the user before the program could be used; with ZCPR33 thisì
  163. installation is performed automatically by the command processor as theì
  164. program is run.
  165.  
  166.  
  167.                              The Alias Program
  168.  
  169.      One of Richard Conn's brilliant concepts in designing ZCPR3 was theì
  170. utility program he called ALIAS, whose function is to create COM files that,ì
  171. in turn, build multiple command lines and insert them into the MCL buffer. ì
  172. When ALIAS is run, it prompts the user for (1) the name of the alias file toì
  173. create and (2) a prototype command line, nowadays called a script.  When theì
  174. resulting COM file is run, it takes the script, uses the information in itì
  175. to construct a complete command line, and then places that command line intoì
  176. the MCL buffer so that the commands it contains will be run.
  177.  
  178.      The simplest script would be nothing more than a completely formedì
  179. command line.  For example, if we wanted to have a command (COM file) thatì
  180. would display the amount of free space on each of drives A, B, and C, weì
  181. could make an alias SPACE.COM containing the script
  182.  
  183.     SP A:;SP B:;SP C:
  184.  
  185. We assume here that our RCP (resident command package) includes the SPì
  186. (space) command.
  187.  
  188.      Such a script can have only a single purpose.  Much more powerfulì
  189. capability is provided when the script can contain parameter expressionsì
  190. that are filled in at the time the command is run.  The aliases produced byì
  191. ALIAS.COM support a number of parameter expressions, including the $1, $2,ì
  192. ... $9 parameters familiar from the SUBMIT facility.  An alias calledì
  193. ASMLINK with a script containing the following command sequence
  194.  
  195.     SLR180 $1
  196.     IF ~ER
  197.     SLRNK /A:100,$1/N,$1,VLIB/S,Z3LIB/S,SYSLIB/S,/E
  198.     FI
  199.  
  200. can then be used to assemble and (if there were no errors in assembly) linkì
  201. any program.  The expression $1 is replaced by the first token on theì
  202. invoking command line after the name of the alias.  A token, we should note,ì
  203. is a contiguous string of characters delimited (separated) by a space or tabì
  204. character.  Thus with the command
  205.  
  206.     ASMLINK MYPROG
  207.  
  208. the string "MYPROG" will be substituted for each of the three occurrences ofì
  209. the expression "$1" in the script to form the command line.  Any commands inì
  210. the MCL after the alias command are appended to the expanded script.
  211.  
  212.  
  213.                             The Advent of ARUNZ
  214.  
  215.      One day it suddenly struck me that Conn-style aliases are extremelyì
  216. inefficient with disk space.  Each one contains, of course, the prototypeì
  217. command line (the script), which is unique and essential to each alias, butì
  218. which is at most about 200 characters long and often much less (17 and 67 inì
  219. the two examples above, if I counted right).  But each one also contains aì
  220. complete copy of the script interpreter and command line manipulation code,ì
  221. about 1K bytes long, which is exactly the same in each alias.  Why not, Iì
  222. thought, separate these two functions, putting all the scripts into aì
  223. single, ordinary text file (ALIAS.CMD) and the alias processing code inì
  224. another, separate file (ARUNZ for Alias-RUN-Zcpr)?
  225.  
  226.      Because there is only a single copy of the ARUNZ code in the systemì
  227. rather than a copy of it with each alias, I felt that I could afford toì
  228. expand the code to include many additional features, in particular much moreì
  229. extensive parameter expansion capability.  These features will be describedì
  230. later.
  231.  
  232.  
  233.                              The ALIAS.CMD File
  234.  
  235.      Let's begin by looking at the structure of the ALIAS.CMD file.  First,ì
  236. we should make it clear that ALIAS.CMD is a plain, ordinary text file thatì
  237. you create using your favorite text editor or word processor (in non¡
  238. document mode).
  239.  
  240.      Each physical line in the file contains a separate alias definition. ì
  241. At present there is no provision for allowing definitions to run over toì
  242. additional lines, so for long scripts your editor has to be able to handleì
  243. documents with a right margin of more than 200 characters.  As I sit hereì
  244. composing this column, it occurs to me that a nice solution to this problemì
  245. might be to allow the ALIAS.CMD file to be created by a word processor inì
  246. document mode and to have WordStar-style soft carriage returns beì
  247. interpreted by ARUNZ.COM as line-continuation characters.  I will experimentì
  248. with that possibility after I finish this column, and if it works there mayì
  249. be an ARUNZ version 0.9H by the time you are reading this.
  250.  
  251.      Each alias definition line contains two parts.  The first part, theì
  252. name field, defines the name or names by which the alias will be recognized,ì
  253. and the second part, the script field, contains the script associated withì
  254. that name or those names.
  255.  
  256.      The name field must start in the very leftmost column (no leadingì
  257. spaces), and the two fields are separated by a space or tab character.  Thusì
  258. ALIAS.CMD might have the following general appearance:
  259.  
  260.     FIRST-NAME-FIELD    first script
  261.     NEXT-NAME-FIELD        next script
  262.     ...            ...
  263.     LAST-NAME-FIELD        last script
  264.  
  265. For ease of reading, I follow the convention of putting the alias name fieldì
  266. in upper case and the script strings in lower case, but you can use anyì
  267. convention (or no convention) you like, since ARUNZ does not generally careì
  268. about case (the sole exception will be described later).
  269.  
  270.      To make the ALIAS.CMD file easier to read, you can include comment andì
  271. formatting lines.  Blank lines are ignored and can be used to separateì
  272. groups of related alias definitions.  Also, any line that begins with aì
  273. space (no name field) will never match an alias name and will thus have theì
  274. effect of a comment line.  You can use this to put titles in front of groupsì
  275. of definitions.
  276.  
  277.      To tell the truth, I always wanted to be able to format the ALIAS.CMDì
  278. file as I just described, but I never got around to adding the code to allowì
  279. it.  As I was sitting here writing just now, I suddenly decided to see whatì
  280. would happen if the ALIAS.CMD file contained such lines.  With BGii inì
  281. operation, a quick '\s' from the keyboard took me to the alternate task, andì
  282. I gave it a whirl.  Imagine my surprise and delight to discover that theì
  283. formatting already works!  No new code is required.
  284.  
  285.  
  286. The Name Field in ALIAS.CMD
  287.  
  288.      The name field can contain a simple name, like SPACE or ASMLINK, butì
  289. more complex and flexible forms are also supported.  First of all, the nameì
  290. field can consist of any number of individual name elements connected by anì
  291. equal sign (with no intervening spaces, since a space would mark the end ofì
  292. the name field).  Thus a line in ALIAS.CMD might have the followingì
  293. appearance:
  294.  
  295.     NAME1=NAME2=NAME3    script string
  296.  
  297.      Secondly, each name element can represent multiple names.  There areì
  298. three characters that have special meanings in a name element.  The first isì
  299. a question mark ('?').  As with CP/M file names, a question mark matches anyì
  300. character, including a blank space.  Thus the alias name DIR? will match anyì
  301. of the following commands: DIR, DIRS, DIRR, and so on.
  302.  
  303.      The second special character is currently the period ('.').  Forì
  304. reasons that I will not go into here (having to do with a new feature underì
  305. consideration for ZCPR34), I may change this to another character (perhapsì
  306. the asterisk), so check the update documentation with any version of ARUNZì
  307. beyond 0.9G.  The period does not match any character, but it signals theì
  308. comparison routine in ARUNZ that any characters after the period areì
  309. optional.  If characters are present in the command name, they must matchì
  310. those in the alias name, but the characters do not have to be present.  Forì
  311. example, the alias name field
  312.  
  313.     FIND.FILE=FILE.FIND
  314.  
  315. will match any of the following commands (and quite a few others as well):ì
  316. FIND, FINDF, FINDFILE, FILE, FILEF, FILEFIND.  It will not, however, matchì
  317. FILES or FINDSTR or FINDFILES.
  318.  
  319.      I have never had any occasion to make use of the capability, but theì
  320. two special characters can be combined in a single name element.  Thusì
  321. FIND.FI?E matches FINDFILE and FINDFIRE but not FINDSTR, and ?DIR.R matchesì
  322. SDIR, SDIRR, XDIR, and XDIRR (but not DIR).  I think you can see that theì
  323. special characters allow for very compact expressions covering many names.
  324.  
  325.      The third special character is the colon (':').  If any name elementì
  326. begins with a colon, then it will match any alias name whatsoever.  This isì
  327. called the default alias, the alias to be run if no other match is found. ì
  328. Since ARUNZ scans through the ALIAS.CMD file from top to bottom searchingì
  329. for a matching name, if the default name is used at all, it makes sense onlyì
  330. as the last alias in the file, since no alias definitions in lines below itì
  331. can ever be invoked.  Note that letters after the colon have noì
  332. significance; you may include them if you wish as a kind of comment.
  333.  
  334.      One possible use for the default alias would be a line like theì
  335. following at the end of the ALIAS.CMD file:
  336.  
  337.     :DEFAULT echo alias $0 not found in alias.cmd
  338.  
  339. If no specific matching alias is found, this default alias will report thatì
  340. fact to the user as a kind of error message.  I do not recommend using theì
  341. default alias in this way, however, because it will interfere with ZCPR33'sì
  342. normal invocation of the error handler when ARUNZ has been set up as theì
  343. extended command processor (ECP) and a bad command is entered.
  344.  
  345.      There is one use of the default alias that can augment the extendedì
  346. command processing power of ZCPR33.  When ARUNZ has been set up as the ECPì
  347. and a command is found neither as a system command, nor COM file, nor ARUNZì
  348. alias, one might want to try running the command from COMMAND.LBR using theì
  349. LX program.  This is a kind of chained ECP operation.  ARUNZ is the first ECP; LX is the second.  This can be accomplished, using version 1.6 or laterì
  350. of LX, by adding the following line at the end of the ALIAS.CMD file:
  351.  
  352.     :ECP-CHAIN lx / $0 $*
  353.  
  354. The meaning of the parameters $0 and $* will be explained later.  With thisì
  355. default alias, if a command cannot be resolved by a specific ARUNZ alias,ì
  356. then an LX command line will be generated to search for a COM file with theì
  357. name of the command in COMMAND.LBR.  The special parameter '/' as the firstì
  358. command line parameter to LX tells LX, when it cannot resolve the commandì
  359. either, to pass to the ZCPR3 error handler only the user command line (i.e.,ì
  360. to omit the "LX / " part of the command).
  361.  
  362.      This might be a good time to note that ARUNZ alias names are notì
  363. limited to only eight characters or to the characters allowed in disk fileì
  364. names.  For example, you have a perfect right to define an alias with theì
  365. name FINDFILES (nine letters) and to invoke it with the command ARUNZì
  366. FINDFILES.  If ARUNZ has been set up as your extended command processor (seeì
  367. my book "The ZCPR33 User Guide" for a discussion of ECPs), then when youì
  368. enter the command FINDFILES, the command processor will first look for aì
  369. disk file FINDFILE.COM, since it truncates the command name to eightì
  370. characters.  If this file is not found, the command processor will then, inì
  371. effect, run ARUNZ FINDFILES, including all nine characters.  I have notì
  372. thought of any uses for aliases with control characters in their names, butì
  373. you can define such aliases if you wish.
  374.  
  375.      Another fine point to be noted is that both leading blank spaces and anì
  376. initial colon are stripped from the command name before scanning for aì
  377. matching alias name.  It is obvious that if leading blanks were notì
  378. stripped, a leading blank would prevent any match from being found.  Theì
  379. colon is stripped so that a command entered as ":VERB" will match an aliasì
  380. name of 'VERB' without the colon.  If a directory specification is includedì
  381. before the colon, it will not be stripped.  When the BADDUECP option isì
  382. enabled in the configuration of ZCPR33, this allows illegal directoryì
  383. specifications to be passed to ARUNZ for processing.
  384.  
  385.  
  386. The Script Field in ALIAS.CMD
  387.  
  388.      The script field in the ALIAS.CMD file contains the prototype commandì
  389. line to be generated in response to a matching alias name.  The scriptì
  390. contains three kinds of items:
  391.  
  392.     (1) characters that are to be put into the command
  393.         line directly
  394.     (2) parameter expressions that ARUNZ is to evaluate
  395.         and convert to characters in the command line
  396.     (3) directives to ARUNZ to perform special operations
  397.  
  398.      There is nothing that has to be said about the first class ofì
  399. characters.  They comprise any characters not covered by the other two sets. ì
  400. The simple example of the SPACE alias, which would appear in ALIAS.CMD as
  401.  
  402.     SPACE sp a:;sp b:;sp c:
  403.  
  404. has only direct characters.  There are no special directives and noì
  405. parameters to evaluate.
  406.  
  407.  
  408. ARUNZ Parameters
  409.  
  410.      ARUNZ supports a very rich set of parameter expressions, which we willì
  411. now describe.  As rich as the set is, there are still important parametersì
  412. that still need to be added.  Some of these will be mentioned later in theì
  413. discussion.  First let's see what we can already do.
  414.  
  415.      Parameters begin with either a caret ('^') or a dollar sign ('$').  Theì
  416. former is quite simple; it is used to signal a control character.  The ASCIIì
  417. representation of the character following the caret is logically ANDed withì
  418. 1FH, and the result is placed into the command line.  Of course, controlì
  419. characters other than carriage return and line feed can equally well beì
  420. placed directly into the script.
  421.  
  422.      At present there is no trap to prevent generating a null characterì
  423. (caret-space will do this: space is 20H, and 20H & 1FH = 00H).  If this isì
  424. used, the resulting null will effectively terminate the command line.  Anyì
  425. characters that come after the null character will be ignored by the commandì
  426. processor.  This could conceivably be useful for deliberately cancellingì
  427. pending commands in a command line, but I have never used it.  In fact, Iì
  428. was surprised to find that I did not have a trap for it.  On thinking aboutì
  429. it now, however, it seems best to continue to allow it.  Just "user beware!"ì
  430. when it comes to employing it.
  431.  
  432.      Parameters introduced by a dollar sign provide much more varied,ì
  433. interesting, and powerful capabilities.  The special ARUNZ directives areì
  434. also introduced by a dollar sign.  A complete list of the characters thatì
  435. can follow the dollar sign, grouped by function, is given below.  Detailedì
  436. discussion of each will follow.
  437.  
  438.     $ ^
  439.     * -
  440.     digit (0..9)
  441.     D U : .
  442.     F N T
  443.     " '
  444.     R M
  445.     I Z
  446.  
  447.  
  448. Character Parameters
  449.  
  450.      The parameters '$' and '^' are provided to allow the two parameterì
  451. lead-in characters to be entered into the command line text.  Many users,ì
  452. present company unhappily included, have made the mistake of trying to enterì
  453. a dollar sign directly into the alias script.  If this is done, the dollarì
  454. sign is (mis)interpreted as a parameter lead-in character.  You must putì
  455. '$$' in the script to get a single dollar sign in the command line.
  456.  
  457.      The worst example I have seen (and committed) of this kind of error isì
  458. in a command like "PATH A0 $$ A0".  This looks perfectly reasonable and doesì
  459. not produce any kind of error message when it runs (as "PATH A0 $0 A0"ì
  460. would, for example, when $0 got expanded to 'PATH').  Unfortunately, it runsì
  461. as "PATH A0 $ A0", where the single dollar sign now means current-drive/user-0 (this is perhaps a flaw in the way the PATH works, but that isì
  462. the way it is).  The proper form of the script is
  463.  
  464.     PATH A0 $$$$ A0
  465.  
  466. where each pair of dollar signs turns into a single dollar sign.
  467.  
  468.  
  469. Complete Command-Tail Parameters
  470.  
  471.      The parameters '*' and '-' refer to entire sections of the command lineì
  472. tail.  The asterisk represents the entire tail exactly as the user enteredì
  473. it.  The parameter expression $-n, where 'n' is a number from 0 to 9,ì
  474. represents the command tail less the first 'n' tokens (a token was definedì
  475. earlier).  The parameter $-0 has the same meaning as $*.
  476.  
  477.      Many users have confused 'command line tail' with 'command line'.  Theì
  478. two are not the same.  A command line consists of the command name (theì
  479. 'verb') and the tail.  Thus the command line tail is the command line lessì
  480. the first token.  Perhaps some examples will help.  Suppose the command lineì
  481. is
  482.  
  483.     command token1 token2 token3 token4
  484.  
  485. Then
  486.  
  487.     $*   =    "token1 token2 token3 token4"
  488.     $-2  =  "token3 token4"
  489.     $-4  =  ""
  490.  
  491. Note that $-4 is the null string; that is, $-4 will be replaced by noì
  492. characters at all.
  493.  
  494.      Also note that there is no leading space in the string assigned to $*. ì
  495. ALIAS.COM (and the earliest version of ARUNZ, I believe) had a bug in thisì
  496. respect in that it did include the leading space in the command line tail,ì
  497. since that is how the tail is stored by the command processor in the bufferì
  498. beginning at memory address 0080H.  The script "find $*" when invoked withì
  499. the tail "string" then became "find  string" with two spaces between "find"ì
  500. and "string".  In such a case, Irv Hoff's FIND program failed to work asì
  501. expected, probably because it was looking for " string" with a leadingì
  502. space.
  503.  
  504.  
  505. Complete Token Parameters
  506.  
  507.      The digit parameters '0' through '9' represent the corresponding tokenì
  508. in the command line that is being parsed.  In the example command line aboveì
  509. the digit parameters have the following values:
  510.  
  511.     $0  =  "command"
  512.     $1  =  "token 1"
  513.     $5  =  ""
  514.  
  515. Except for the '0' parameter, these parameters are familiar from the CP/Mì
  516. SUBMIT facility.  The expression $0 is an extension used to represent theì
  517. command verb itself.  Just think of the tokens on the command line as beingì
  518. numbered in the usual computer fashion starting with zero instead of one.  Aì
  519. token that is absent from the command line returns a null string (noì
  520. characters) as with $5 in the above example.
  521.  
  522.      As just mentioned, many users confuse the command line tail and theì
  523. command line.  If you want only the tail, use the parameter $*.  If you wantì
  524. to represent the entire command line, use the expression "$0 $*".  Mostì
  525. often it is the command line tail that is to be passed to a command, and theì
  526. ALIAS.CMD line will read something like
  527.  
  528.     ALIAS realverb $*
  529.  
  530. This is a direct implementation of the common meaning of 'alias' as anotherì
  531. name for something.  When ALIAS is invoked, we simply want to substituteì
  532. 'realverb' for it while leaving the command tail as it was.
  533.  
  534.      There are other occasions, however, as with the LX default aliasì
  535. example given earlier, where the entire command line must be passed.  Thereì
  536. are still other occasions, such as in the first default alias example above,ì
  537. where only the name of the verb used is needed.  Because a given script inì
  538. ALIAS.CMD can correspond to many possible alias names, it is important toì
  539. have a parameter that will return the name that was actually used in anyì
  540. particular instance.
  541.  
  542.  
  543. Token Parsing Parameters
  544.  
  545.      There are many instances in which it is extremely useful to be able toì
  546. break any token down into its constituents.  The parameters  'D', 'U', ':',ì
  547. and '.' do this.  They assume that the token is in the form of a fileì
  548. specification, which may have (1) a directory specification using either aì
  549. named directory or a drive and/or user number; and/or (2) a file name;ì
  550. and/or (3) a file type.  Each of the four parameters above is followed by aì
  551. number from 1 to 9 to designate the token to parse ('D' and 'U' can alsoì
  552. have a 0).  After discussing each one individually, we will give someì
  553. examples.
  554.  
  555.      The parameter 'D' returns the drive specified or implied in theì
  556. designated token.  If there is no directory specification or if only a userì
  557. number is given, then $Dn returns the default (logged) drive at the timeì
  558. ARUNZ constructs the command line.
  559.  
  560.      WARNING -- NOTE WELL: this is not necessarily the drive that will beì
  561. logged in at the time when that part of the command actually executes!! ì
  562. This, too, has been the source of grief in the use of ARUNZ.  ARUNZ has noì
  563. infallible way to know what directory will be logged in when some futureì
  564. command runs; it only knows what directory is the default directory at theì
  565. time ARUNZ itself is running.
  566.  
  567.      The 'U' parameter is similar in all respects to 'D', and the sameì
  568. warning applies.  The parameters $D0 and $U0 can also be used.  They alwaysì
  569. return the default drive and user at the time ARUNZ interprets the script.
  570.  
  571.      The parameter ':' represents the file name part of the token, while theì
  572. parameter '.' represents the file type part of the token.  One way toì
  573. remember the characters for these two parameters is to think that colonì
  574. stands for the part of the token after a colon and period stands for theì
  575. part of the token after a period.  Admittedly, 'N' for name and 'T' for typeì
  576. would have been more sensible, but as we shall see shortly, these areì
  577. already used for something else.
  578.  
  579.      Generally speaking, the entire token can be represented as
  580.  
  581.     $Dn$Un:$:n.$.n
  582.  
  583. where 'n' is a digit.
  584.  
  585.      Let us consider some examples.  Suppose the following command isì
  586. entered at the prompt:
  587.  
  588.     B1:WORK>command root:fn1.ft1 c:fn2 2:.ft3
  589.  
  590. and that COMMAND.COM is not found, so that the command is passed on to ARUNZì
  591. and the extended command processor.  Also assume that the ROOT directory isì
  592. A15.  Then here are the values of the parameters for the four tokens in theì
  593. command:
  594.  
  595.     $D0 = "B"    $U0 = "1"    $0  = "COMMAND"
  596.  
  597.     $1  = "ROOT:FN1.FT1"
  598.     $D1 = "A"    $U1 = "15"    $:1 = "FN1"    $.1 = "FT1"
  599.  
  600.     $2  = "C:FN2"
  601.     $D2 = "C"    $U2 = "1"    $:2 = "FN2"    $.2 = ""
  602.  
  603.     $3  = "2:.FT3"
  604.     $D3 = "B"    $U3 = "2"    $:3 = ""    $.3 = "FT3"
  605.  
  606. Note the value of the following parametric expression:
  607.  
  608.     $D1$U1:$:1.$.1  =  "A15:FN1.FN2"
  609.  
  610. You can see that the 'D' and 'U' parameters can be used to convert a namedì
  611. directory into its drive/user form.
  612.  
  613.  
  614. System File Name Parameters
  615.  
  616.      The ZCPR3 ENV contains four system file names, each with a name and aì
  617. type.  These file names, numbered 0..3, are used by various programs,ì
  618. especially shells.  VFILER and ZFILER, for example, keep the name of theì
  619. file currently pointed to in system file name 1.  These file names can alsoì
  620. be read and set using the utility program SETFILE.
  621.  
  622.      The parameters 'F', 'N', and 'T' followed by a digit from 0 to 3ì
  623. return, respectively, the entire filename (name.typ), file name, and fileì
  624. type of the specified system file.
  625.  
  626.  
  627. User Input Parameters
  628.  
  629.      The single and double quote parameters are used for prompted userì
  630. input.  The forms of the parameter expressions are
  631.  
  632.     $"prompt"   or   $'prompt'
  633.  
  634. When the parameter $" or $' has been detected, any characters in the scriptì
  635. up to the matching parameter character or the end of the script line areì
  636. echoed as a prompt to the user's screen.  These characters are echoedì
  637. exactly as they appear in the script; no conversion to upper case isì
  638. performed.  The prompt string for the double quote parameter can containì
  639. single-quote characters, and the prompt string for the single quoteì
  640. parameter can contain double-quote characters.  There is, at present, no wayì
  641. to include the type of quote character used as the parameter in the promptì
  642. string.
  643.  
  644.      After the prompt has been output to the console, ARUNZ reads in a lineì
  645. of input from the console (user input).  At this point there is a subtle butì
  646. important distinction between the two user input parameters.  The singleì
  647. quote form takes the entire text string entered from the console and placesì
  648. it in the command line.  In particular, this input may contain semicolons,ì
  649. allowing the user to enter multiple commands.  The double quote form ignoresì
  650. a semicolon and any text thereafter.  This is intended for secure systems,ì
  651. where it prevents the user, when prompted for a program option, fromì
  652. slipping in complete additional commands.
  653.  
  654.      One pitfall to which many users have succumbed is the failure toì
  655. appreciate that the user input parameters perform their function at the timeì
  656. that ARUNZ is running and interpreting the script, not when the program inì
  657. the command line is running.  Consider the alias definition
  658.  
  659.     ERAFILE dir $1;era $"File name to erase: "
  660.  
  661. The intention here is to first display a list of the files that match theì
  662. first command line token and then to allow the user to enter the one to beì
  663. erased.  This is not what will happen.  ARUNZ will put up the prompt "Fileì
  664. name to erase: " at the time the command line is being built, i.e., beforeì
  665. DIR is run.  The prompt will come before the directory display.
  666.  
  667.      The way around this problem is to use two ARUNZ aliases as follows:
  668.  
  669.     ERAFILE        dir $1;/eraprompt
  670.     ERAPROMPT    era $"File name to erase: "
  671.  
  672. Now when ERAFILE is run, it will display the directory and then run theì
  673. command "/ERAPROMPT".  The slash here is a ZCPR33 feature that indicatesì
  674. that the command should be sent directly to the extended command processor. ì
  675. This saves the time that would otherwise be wasted searching for a fileì
  676. named ERAPROMPT.COM (actually, ERAPROMP.COM, since the ninth character willì
  677. be truncated from the name).  If you are not running ZCPR33 (but you shouldì
  678. be!!) or are running BGii, use a space instead.  This will work with bothì
  679. ZCPR33 and BGii and will have no effect in ZCPR30.  I am using the slash inì
  680. the examples because a space is hard to see in print.  When ERAPROMPT runsì
  681. and the user is prompted for the name, the directory listing will already beì
  682. on the screen.
  683.  
  684.      Whenever console input is requested by any program, one must keep inì
  685. mind the possibility that ZEX will be running and consider the question ofì
  686. whether the input request should be satisfied from the ZEX script or byì
  687. direct user input.  ARUNZ is configured, in the absence of a specificì
  688. directive to the contrary, to turn ZEX input redirection off during ARUNZì
  689. prompted input.  Thus, even if ZEX is running at the time ARUNZ is invoked,ì
  690. the user input parameters will request live user input.
  691.  
  692.      If you do want ZEX to be able to provide the response to ARUNZ promptedì
  693. input automatically from the ZEX script, then you must include the ARUNZì
  694. directive $I ('I' for input redirection) before the $" or $' parameter.  Theì
  695. $I directive is effective only for the next user input operation.  Afterì
  696. each prompted user input operation, the default for ZEX input redirection isì
  697. turned off.  The $I directive need not immediately precede the $" or $' butì
  698. there must be a separate $I for each input requested.
  699.  
  700.  
  701. Register and Memory Parameters
  702.  
  703.      Two parameters are provided for referencing values of the ZCPR3 userì
  704. registers and the contents of any memory location in the system.
  705.  
  706.      By Richard Conn's original specification, there were ten user registersì
  707. numbered from 0 to 9.  However, the block of memory in which those tenì
  708. registers fall is actually 32 bytes long.  Conn designated the last 16 bytesì
  709. of this block as 'user definable registers', but he and others later usedì
  710. them in programs such as Term3 and Z-Msg.  As a result, one has to be veryì
  711. careful in making use of them.  The last 6 bytes of the first half of theì
  712. block were defined as 'reserved bytes'.  Various uses have been made of themì
  713. as well.
  714.  
  715.      The ARUNZ parameter 'R' can reference any of the first 16 bytes usingì
  716. the form $Rn, where 'n' is a hexadecimal digit.  The decimal digitsì
  717. reference the true user registers, and the additional digits 'A' through 'F'ì
  718. reference the reserved bytes.  In the current version of ARUNZ, the value isì
  719. returned as a two character hexadecimal value.  However, I would like toì
  720. provide in the future a way to return the value in either decimal orì
  721. hexadecimal form.  A complication with the decimal form is the need toì
  722. indicate the format: one character, two characters with leading zeros, threeì
  723. characters with leading zeros, or the number of characters required for theì
  724. particular value with no leading zeros.
  725.  
  726.      One of the uses I envisioned for this parameter, though I have neverì
  727. actually used it this way, is for automatic sequential numbering of files. ì
  728. Thus a script might include the string "copy $:1$r3.$.1=$1;reg p3".  Thisì
  729. would copy the working file given by token 1 to a new file with the hexì
  730. value of register 3 appended to the file name.  For a file name of PROG.Z80ì
  731. this might be PROG03.Z80.  Then the value of register 3 would be incrementedì
  732. so that the next file name in sequence (PROG04.Z80) would be used the nextì
  733. time the alias was invoked.
  734.  
  735.      The parameter 'M' is used in the form $Mnnnn, where 'nnnn' is aì
  736. precisely four-digit hexadecimal address value.  The parameter returns theì
  737. two character hexadecimal value of the byte at the specified memory address. ì
  738. I use this on my RAS to determine if the system is running in local mode. ì
  739. The BDOS page at address 0007H has a different value when BYE is running. ì
  740. There might be a script of the form
  741.  
  742.     if eq $m0007 c6;....;else;echo not allowed in remote mode;fi
  743.  
  744. The commands represented by the ellipsis "...." will run only if in localì
  745. mode (BDOS apparently located at page C6H).
  746.  
  747.  
  748. ARUNZ Directives
  749.  
  750.      There are presently two ARUNZ directives.  We already discussed one ofì
  751. them, 'I', under the user input parameters.  The other one is 'Z'.
  752.  
  753.      Ordinarily, once ARUNZ has interpreted the alias script and evaluatedì
  754. the parameters, it appends to the resulting command line any commands in theì
  755. multiple command line buffer that have not already been executed.  This isì
  756. usually what one wants.  There is one possible exception.
  757.  
  758.      As I discussed in issues #27 and #28 of The Computer Journal, oneì
  759. sometimes wants an alias to invoke itself or other aliases recursively. ì
  760. This can sometimes lead to problems with the build up of unwanted pendingì
  761. commands that eventually causes the command line to overflow the bufferì
  762. space allowed for it.  In such a case one might want only the currentì
  763. expanded script command line to be placed in the MCL, with any pendingì
  764. commands dropped.  A $Z directive anywhere in the script will cause ARUNZ toì
  765. do this.  Note that the directive is not a toggle; multiple uses has theì
  766. same effect as a singe use.  Remember, however, that Dreas Nielsen's aliasì
  767. recursion technique, described in issue #28 and in examples below, isì
  768. generally preferable to the technique using $Z.
  769.  
  770.  
  771.                        Applications for ARUNZ Aliases
  772.  
  773.      In this section I will use a number of sample scripts to illustrateì
  774. various ways in which one can make use of the power of ARUNZ aliases.  I'mì
  775. sure there are many I have not thought of, and I invite you to send me yourì
  776. suggestions and examples.  In all cases I will be assuming that ARUNZ is theì
  777. extended command processor (typically renamed to CMDRUN.COM).
  778.  
  779.      In general, one can identify the following classes of aliasì
  780. applications:
  781.  
  782.     (1) providing synonyms for commands
  783.     (2) trapping and/or correcting command errors
  784.     (3) automating complex operations into single commands
  785.  
  786. Within the last category fall two special subclasses:
  787.  
  788.     (a) performing 'get, poke, & go' operations
  789.     (b) providing special functions like recursion and repetition
  790.  
  791.  
  792. Command Synonyms
  793.  
  794.      The most basic use of aliases is to provide alternative names for
  795. commands.  Here are some examples from my personal ALIAS.CMD file.
  796.  
  797.      For displaying the directory of a library file, I now use the programì
  798. LLF.  However, after years of using LDIR, both before LLF was released andì
  799. still on most remote access systems, I prefer to use that name and haveì
  800. renamed LLF.COM to LDIR.COM.  Sometimes, however, I forget or want to beì
  801. sure I am running LLF and enter the command LLF explicitly.  Then I am savedì
  802. by the alias line
  803.  
  804.     LLF ldir $*
  805.  
  806. Similarly, I have recently begun to use LBREXT instead of LGET.  LGET isì
  807. easier to type, and I am used to it, so I have the alias
  808.  
  809.     LGET lbrext $*
  810.  
  811. LBREXT is so new that I did not want to rename it to LGET, since I might tooì
  812. easily forget which program the disk file really is.  I know I never haveì
  813. the old LDIR.COM around any more.  In both of these examples, the aliasì
  814. simply substitutes a different verb in the command line; the tail is leftì
  815. unchanged.
  816.  
  817.      Before the advent of ZCPR33, when path searching always included theì
  818. current directory, I would speed up the disk searching in these cases byì
  819. including an explicit directory reference with the script.  Thus the twoì
  820. commands above might be
  821.  
  822.     LLF   a0:ldir $*
  823.     LGET  a0:lbrext $*
  824.  
  825. This way the command processor would go straight to A0 no matter where I wasì
  826. logged in at the time.
  827.  
  828.      With ZCPR33 one can bypass the path search for commands that one knowsì
  829. are in ALIAS.CMD by entering the command with a leading space or slashì
  830. (assuming the usual configuration of ZCPR33).  Sometimes I might try toì
  831. outfox the system and, thinking LBREXT is the alias name, enter the commandì
  832. as '/LBREXT ...'.  So that this will work, I extend the alias lines to
  833.  
  834.     LLF=LDIR     a0:ldir $*
  835.     LGET=LBREXT  a0:lbrext $*
  836.  
  837. The command is an alias for itself!!  Odd, but useful.  It is a good idea ifì
  838. you do this, however, to be absolutely sure to include an explicit directoryì
  839. prefix before the command name in the script.  If you don't, the followingì
  840. situation can arise.  Suppose the alias line reads
  841.  
  842.     TEST test $*
  843.  
  844. but for some reason TEST.COM is not on the disk (or at least not on theì
  845. search path).  Now you enter the command TEST.  The command cannot be foundì
  846. as a COM file, so the command processor sends it to ARUNZ.  ARUNZ proceedsì
  847. to regenerate the same command, which again cannot be found, and so on untilì
  848. you press the little red button or pull the plug.  Not always to completeì
  849. catastrophe, but definitely a nuisance.  With ZCPR33, if the command has anì
  850. explicit directory prefix, control is passed directly to the error handlerì
  851. if the COM file cannot be found in the specified directory.  It figures thatì
  852. if you go to the trouble of specifying the directory, you must mean to lookì
  853. there only.
  854.  
  855.      Another use for synonyms is to allow a short-form entry of commands. ì
  856. Here are two examples:
  857.  
  858.     SLR.180  asm:slr180 $*
  859.     ED.IT    sys:edit $*
  860.  
  861.      Synonyms are especially helpful on a remote access system or on anyì
  862. system that will be used by people who are not familiar with it or expert inì
  863. its use.  Consider, for example, the task of finding out if a certain fileì
  864. is somewhere on the system and where.  Some systems use FINDF, the originalì
  865. ZCPR3 program for this purpose; others use one of the standard CP/M programsì
  866. (WIS or WHEREIS); and others have begun to use the new, enhanced ZSIGì
  867. program called FF.  This can be very confusing to new users or to users whoì
  868. call many different systems.  The solution is to provide aliases for all theì
  869. alternatives.  Suppose FF is the real program in use.  Then the followingì
  870. line in ALIAS.CMD will allow all the forms to be used equally:
  871.  
  872.     FINDF=WIS=WHEREIS ff $*
  873.  
  874. In fact, while I am at it, I usually throw in a few other forms that someoneì
  875. might try and that are sufficiently unambiguous that one can guess with someì
  876. confidence that this is the function the user intended:
  877.  
  878.     FIND.FILE=FILE.FIND=WIS=WHERE.IS=FF a0:ff $*
  879.  
  880. Note that this single alias, which occupies only 46 bytes in ALIAS.CMDì
  881. (including the CRLF at the end of the line), responds to 8 commonly usedì
  882. commands for finding files on a system.  Thus the cost is a mere 6 bytes perì
  883. command!!
  884.  
  885.  
  886. Trapping and Correcting Command Errors
  887.  
  888.      Aliases can be used to trap commands that would be errors and eitherì
  889. convert them into equivalent valid commands or provide some warning messageì
  890. to the user.
  891.  
  892.      It is generally not desirable to have a very long search path, becauseì
  893. every time a command is entered erroneously, the entire path has to beì
  894. searched before the extended command processor will be brought into play. ì
  895. On my SB180 with its RAM disk, I sometimes want the path to include onlyì
  896. M0:, the RAM disk directory.  The RAM disk, of course, cannot contain all ofì
  897. the COM files I use.  For COM files that reside on the floppy disk, I canì
  898. include an alias.
  899.  
  900.      For example, MEX.COM and all its associated files take up a lot of diskì
  901. space, and I keep them in a directory called MEX on my floppy drive B.  Theì
  902. ALIAS.CMD file can have the line
  903.  
  904.     MEX mex:mex $*
  905.  
  906. Without this alias I would have to remember to enter MEX:MEX manually.  If Iì
  907. forgot, I would get the error handler and then have to edit the line toì
  908. include the MEX: prefix.  The 16-byte entry above in the ALIAS.CMD fileì
  909. saves me all this trouble.
  910.  
  911.      Every computer user probably has some commands whose names heì
  912. habitually mistypes (switching 'g' and 'q' for example or reversing twoì
  913. letters).  My fingers seem to prefer 'CRUNHC' to 'CRUNCH', so I have theì
  914. following alias line:
  915.  
  916.     CR.UNHC crunch $*
  917.  
  918. Note that while I am at it, I allow the shorter form CR as well.  My fingersì
  919. like that even better.
  920.  
  921.      On a remote access system there are many situations where correctingì
  922. common mistakes can be handy.  Richard Jacobson (Mr. Lillipute, sysop of theì
  923. RAS that now serves TCJ subscribers) calls my Z-Node quite often.  Either heì
  924. has a Wyse keyboard with very bad bounce (as he claims) or he is a lousyì
  925. typist (and refuses to admit it).  When he wants to display a directory, hisì
  926. command is more likely to come out DDIR or DIRR than it is to come outì
  927. correctly as DIR.  So I added those two forms to my existing alias whichì
  928. allowed XD and XDIR (and /DIR); it now reads:
  929.  
  930.     XD.IR=DDIR=DIR.R a0:dir $*
  931.  
  932. Compensating for Richard's keyboard stutter takes up only seven extra bytesì
  933. on my disk, not a very big sacrifice to make for a friend!
  934.  
  935.      Another example, one that is more than just a synonym for a mistypedì
  936. command, is an alias that comes into play when a command becomesì
  937. unavailable, perhaps because of a change in security level.  The RCP may,ì
  938. for example, have an ERA command that is only available when the wheel byteì
  939. is set.  When the wheel byte is off, ZCPR33 will ignore the command in theì
  940. RCP and forward an ERA command to the extended command processor or errorì
  941. handler (assuming there is no ERA.COM).  You might want to trap the errorì
  942. before the error handler gets it using an alias such as
  943.  
  944.     ERA echo e%>rasing of files not allowed
  945.  
  946. When the wheel byte is set, the ERA command will execute normally (unlessì
  947. entered with a leading space or slash).  When the wheel byte is off, theì
  948. user will get the message "Erasing of files not allowed", which, unlike theì
  949. invocation of an error handler, makes the situation perfectly clear.
  950.  
  951.      It is obviously very hard for users to remember the DU forms forì
  952. directories on a remote system, and that is one reason why named directoriesì
  953. are provided.  But even names are not always easy to remember precisely.ì
  954. Aliases can help by providing alternative names for logging intoì
  955. directories, provided ZCPR33 has been assembled with the BADDUECP optionì
  956. enabled so that invalid directory-change references are passed on to theì
  957. extended command processor.
  958.  
  959.      Suppose you have a directory called Z3SHELLS.  One might easily forgetì
  960. the exact name and think that it is Z3SHELL or SHELLS or SHELL.  Theì
  961. following line in ALIAS.CMD
  962.  
  963.     Z3SHELL:=SHELL:=SHELLS: z3shells:
  964.  
  965. would take care of all of these possibilities.  Note, however, that it willì
  966. not help a reference like "DIR SHELL:".  [If you wanted this to be accepted,ì
  967. you would have to go to considerable trouble.  You might be able to go intoì
  968. the NDR (named directory register) and tack onto the end an entry for aì
  969. directory named SHELL associated with the same drive and user as Z3SHELLS. ì
  970. All existing NDR editors will not allow a DU area to have more than oneì
  971. name, so you would have to use a debugger or patcher.  If anyone tries this,ì
  972. let me know if it works.]
  973.  
  974.      I occasionally slip up and omit the colon on the end of a directoryì
  975. change command (and users on my Z-Node do it surprisingly often).  It isì
  976. very easy for ARUNZ to pick this up as well and add the colon for you.  Justì
  977. include the following alias line:
  978.  
  979.     Z3SHELL=Z3SHELLS=SHELL=SHELLS z3shells:
  980.  
  981. All of these aliases can be combined into the single script:
  982.  
  983.     Z3SHELL.:=Z3SHELLS=SHELL.:=SHELL.S: z3shells:
  984.  
  985. Seven forms are covered by an entry of only 47 bytes, a cost of less than 7ì
  986. bytes each.  Note that the name element Z3SHELLS, unlike the other threeì
  987. name elements, does not allow an optional colon.  If it were included andì
  988. for some reason there were no directory with the name Z3SHELLS, you couldì
  989. get into an infinite loop.
  990.  
  991.      On my Z-Node I provide a complete set of aliases for all possibleì
  992. directories so that any legal directory can be entered with or withoutì
  993. colons and using either the DIR or the DU form.  Thus, if Z3SHELLS is B4,ì
  994. the script above would be:
  995.  
  996.     Z3SHELL.:=Z3SHELLS=SHELL.:=SHELL.S:=B4.: z3shells:
  997.  
  998.      Before ZCPR33 came along and provided this service itself, I wouldì
  999. allow callers to use the DU form to log into unpassworded named directoriesì
  1000. beyond the max-drive/max-user limits by including aliases of the above form. ì
  1001. If the maximum user area were 3 in the above example, the commands "B4:" andì
  1002. "B4" would still have worked (even under ZCPR30) because ARUNZ mapped themì
  1003. into a DIR form of reference.  Although this is no longer necessary withì
  1004. ZCPR33, a complete alias line like the one above covers all bases. The userì
  1005. can even enter any of the commands with a leading space or slash and theyì
  1006. will still work.
  1007.  
  1008.      Finally, I provide on the Z-Node a catch-all directory change alias toì
  1009. pick up directory change commands that don't even come close to somethingì
  1010. legal.  At the end of ALIAS.CMD (i.e., after all the other directory-changeì
  1011. aliases described above, so that they get the first shot at matching), Iì
  1012. include the line
  1013.  
  1014.     ?:=??:=???:=????:=?????:=??????:=???????:=????????: echo
  1015.       d%>irectory %<$0%> is not an allowed directory.  %<t%>he^m^j
  1016.       valid directories are:;pwd
  1017.  
  1018. Thus when the user enters the command "BADDIR:", he get the PWD display ofì
  1019. the system's allowed directories prefixed by the message
  1020.  
  1021.     Directory BADDIR: is not an allowed directory.  The
  1022.     valid directories are:
  1023.  
  1024. [Note the use of Z33RCP's advanced ECHO command with case shifting ('%< toì
  1025. switch to upper case and '%>' to switch to lower case) and control characterì
  1026. inclusion (caret followed by the character).]
  1027.  
  1028.  
  1029. Automating Complexity
  1030.  
  1031.      Complexity is a relative term, and in my old age (also relative) Iì
  1032. enjoy the luxury of letting my computer perform as much labor on my behalfì
  1033. as it possibly can.  We already saw how ARUNZ aliases can provide shortì
  1034. forms for commands (CR for CRUNCH).  It can also allow one to completelyì
  1035. omit commands.
  1036.  
  1037.      At work I have been maintaining a phone directory in a file calledì
  1038. PHONE.DIR.  I got tired of invoking my PMATE text editor using the commandì
  1039. "EDIT A0:PHONE.DIR", so I added the following line to ALIAS.CMD:
  1040.  
  1041.     PHONE edit a0:phone.dir
  1042.  
  1043. Now I just type PHONE and, bingo, I'm in the editor ready to add a new name. ì
  1044. Similarly, I used to look up numbers for people using JETFIND as follows:
  1045.  
  1046.     JF -gi smith|jones a0:phone.dir
  1047.  
  1048. This would give me, from any directory, a paginated listing of lines inì
  1049. PHONE.DIR containing either "smith" or "jones" (ignoring case).  My poorì
  1050. tired fingers ache just thinking about all that typing.  Now I have theì
  1051. alias line
  1052.  
  1053.     #=CALL=NUM.BER jf -gi $1 a0:phone.dir
  1054.  
  1055. Now a simple " # smith" puts Smith's number up on my clean CRT screen in aì
  1056. jiffy.
  1057.  
  1058.      Here is another frequent command that causes severe finger cramps.  Youì
  1059. want to find all the files in the current directory that have a typeì
  1060. starting with 'D'.  You have to type "XD *.D*".  Wouldn't it be nice to haveì
  1061. a directory program that automatically wildcarded the file specification. ì
  1062. While I was fixing up FINDF to make my new FF, I built that feature into theì
  1063. code.  I've been too busy or too lazy to do the same for XD, so instead Iì
  1064. added the alias line
  1065.  
  1066.     D xd $d1$u1:$:1*.$.1* $-1
  1067.  
  1068. This is a little hard to decipher at a glance because of all the dots andì
  1069. colons and asterisks.  But here's how it works.  Suppose we are in B4: andì
  1070. enter "D .D /AA" (the option /AA means to include SYS and DIR type files). ì
  1071. The parameters in the alias have the following values:
  1072.  
  1073.     $D1 = "B"    $U1 = "4"        current drive and user, since
  1074.                     none given explicitly
  1075.  
  1076.     $:1 = ""            no file name given
  1077.  
  1078.     $.1 = "D"            file type in first parameter
  1079.  
  1080.     $-1 = "/AA"            the tail less the first token ".D"
  1081.  
  1082. The command is thus translated by ARUNZ into
  1083.  
  1084.     XD B4:*.D* /AA
  1085.  
  1086.      Sometimes it can be nice to allow a command that takes a number ofì
  1087. alternative options to run with only the option entered on the command line. ì
  1088. I have a read file for MEX that provides automated, menu-based operation onì
  1089. PC-PURSUIT.  I could invoke it as "MEX PCP".  Instead, I have the alias
  1090.  
  1091.     PCP  mex pcp
  1092.  
  1093. I also do this with the KMD file transfer commands on my Z-Node, where Iì
  1094. define the following aliases:
  1095.  
  1096.     S    kmd s $*
  1097.     SK    kmd sk $*
  1098.     SB    kmd sb $*
  1099.     SBK    kmd sbk $*
  1100.     SP    kmd sp $*
  1101.     SPK    kmd spk $*
  1102.     R    kmd r $*
  1103.     RP    kmd rp $*
  1104.     RB    kmd rb
  1105.     RP    kmd rp $*
  1106.     L    kmd l $*
  1107.     LK    kmd lk $*
  1108.  
  1109. This way the user can skip typing "KMD".  Actually, these aliases eachì
  1110. contain numerous other synonyms as well.  The 'S' alias, for example,ì
  1111. includes "SEND", "DOWN", and "DOWNLOAD" as well.  The cost in terms of diskì
  1112. space to add all these aliases is so small that I let my enthusiasm andì
  1113. imagination run wild.  Note, however, that with the above aliases defined,ì
  1114. the RCP should not have the 'R' (reset) and 'SP' (space) commands, sinceì
  1115. they will take precedence over the alias.  I changed the names of theseì
  1116. commands to 'RES' and 'SPAC'.  The remote user has no reason to use themì
  1117. anyway.
  1118.  
  1119.      There are, of course, many really complicated sequences of commandsì
  1120. (editing, assembling, and linking files, for example) that can very nicelyì
  1121. be performed by aliases.  Those are fairly obvious, and I have describedì
  1122. quite a few in previous columns.  I won't give any more examples here, but Iì
  1123. will describe two special applications where ARUNZ aliases cut down aì
  1124. complex process to simple proportions.  The first is automation of the get-poke-go technique pioneered by Bruce Morgen.
  1125.  
  1126.  
  1127. Automated GET-POKE-GO
  1128.  
  1129.      Here the alias does more than just save typing -- it remembers theì
  1130. addresses that have to be poked, something you probably can't do.  I willì
  1131. illustrate it with an intriguing example that is sort of recursive.
  1132.  
  1133.      Suppose ARUNZ is the extended command processor, has been renamedì
  1134. CMDRUN.COM, and is set to get its ALIAS.CMD file from the root directory. ì
  1135. Next, suppose you also want to be able to invoke it manually and have it, inì
  1136. that case, look for its ALIAS.CMD file along the entire path, including theì
  1137. current directory.  Suppose, furthermore, that CMDRUN.COM is a type-3ì
  1138. program that loads and runs at address 8000H.
  1139.  
  1140.      By inspecting CMDRUN.COM, we find that we have to poke a 0 at offsetì
  1141. 1CH (address 801CH) to turn off the ROOT configuration option and an FFH atì
  1142. offset 24H (address 8024H) to turn on the SCANCUR option.  If we are to makeì
  1143. manual invocations using the alias name 'RUN', we can put the following lineì
  1144. in the ALIAS.CMD file in the root directory, where the unpoked CMDRUN.COMì
  1145. will find it:
  1146.  
  1147.     RUN get 8000 cmdrun.com;poke 801c 0;poke 8024 ff;jump 8000 $*
  1148.  
  1149. I particularly chose this example because it illustrates the slightly moreì
  1150. advanced version of GET-POKE-GO called GET-POKE-JUMP.  One word of caution. ì
  1151. This technique will only work under ZCPR33.  BGii version 1.13 is very closeì
  1152. to ZCPR33, but it still handles the JUMP command the way ZCPR30 did, and itì
  1153. cannot use JUMP when a command tail is processed.
  1154.  
  1155.      I will now describe two very special operations that can be performedì
  1156. very nicely with ARUNZ aliases: recursion and repetition.
  1157.  
  1158.  
  1159. Special Recursion Aliases
  1160.  
  1161.      The following pair of aliases (more or less) that implement Dreasì
  1162. Nielsen's recursion technique were described in my column in issue 28.  Theyì
  1163. allow one to execute a single command recursively.  With each cycle the userì
  1164. will be asked if he wants to continue.  So long as the answer is yes, theì
  1165. command will be executed repeatedly.  Upon a negative reply, the recursiveì
  1166. sequence will terminate, and any pending commands will execute.
  1167.  
  1168.      The alias that the user invokes can be called "REC.URSE" so that it canì
  1169. be invoked with a simple 'REC'.  It contains the following sequence ofì
  1170. commands:
  1171.  
  1172.     if nu $1
  1173.       echo;echo %<  s%>yntax: %<$0 cmdname [parameters]^j
  1174.     else
  1175.       /recurse2 $*
  1176.     fi
  1177.  
  1178. If invoked without at least a command name, this alias echoes a syntaxì
  1179. message to the screen.  Otherwise it invokes the second alias RECURSE2.  Theì
  1180. leading slash speeds things up by signaling the ZCPR33 command processorì
  1181. that it should go directly to the extended command processor.  If you areì
  1182. using BackGrounder-ii (version 1.13), the slash should be replaced by aì
  1183. space (the alias will then work with BGii or Z33).  If you are using ZCPR30,ì
  1184. don't use either; a space won't do you any good, and a slash will cause theì
  1185. command to fail.
  1186.  
  1187.      The alias that does the real recursion (RECURSE2) has the followingì
  1188. sequence of commands:
  1189.  
  1190.     fi
  1191.     $*
  1192.     if in r%>un %<"$*" %>again?
  1193.       /$0 $*
  1194.  
  1195. If the user answers the 'run again' query affirmatively, RECURSE2 will beì
  1196. invoked again.  By using '$0' instead of 'RECURSE2' the script will workì
  1197. even if we later change its name.
  1198.  
  1199.  
  1200. Special REPEAT Alias
  1201.  
  1202.      Here is a simple special alias that will allow a command that takes aì
  1203. single argument (token) to be repeated over a whole list of argumentsì
  1204. separated by spaces (not commas).  The name of the alias is "REP.EAT" soì
  1205. that it can be invoked with a brief 'REP'.  The script contains theì
  1206. following commands:
  1207.  
  1208.     $zxif
  1209.     if ~nu $2
  1210.       echo $1 $2
  1211.       $1 $2
  1212.     fi
  1213.     if ~nu $3
  1214.       /$0 $1 $-2
  1215.     fi
  1216.  
  1217. The '$z' in the first line declares the alias to be in recursive mode (anyì
  1218. pending commands in the multiple command line buffer are dropped when thisì
  1219. alias executes), and 'xif' clears the flow state.  Invoked as
  1220.  
  1221.     REPEAT CMDNAME ARG1 ARG2 ARG3
  1222.  
  1223. for example, interpretation of the script the first time through results inì
  1224. the following commands:
  1225.  
  1226.     xif
  1227.     if ~nu arg1
  1228.       echo cmdname arg1
  1229.       cmdname arg1
  1230.     fi
  1231.     if ~nu arg2
  1232.       /repeat cmdname arg2 arg3
  1233.     fi
  1234.  
  1235. The command line generated ("CMDNAME ARG1") is first echoed to the screen soì
  1236. the user knows what is going on, and then it is run.  Since there is aì
  1237. second argument, the alias is reinvoked as "REPEAT CMDNAME ARG2 ARG3".  Noteì
  1238. that the first argument has been stripped away.  After "CMDNAME ARG2" hasì
  1239. also been run and stripped from the command, the interpreted command stringì
  1240. will be:
  1241.  
  1242.     xif
  1243.     if ~nu arg3
  1244.       echo cmdname arg3
  1245.       cmdname arg3
  1246.     fi
  1247.     if ~nu
  1248.      /repeat cmdname
  1249.     fi
  1250.  
  1251. This time the null test in the second IF clause will fail, and the cycle ofì
  1252. commands will come to an end.
  1253.  
  1254.      This form of the REPEAT alias suffers from the problems Dreas Nielsenì
  1255. pointed out (it wipes out any commands following it on the original commandì
  1256. line).  A rigorous version can be made (adapting Dreas's technique) byì
  1257. making two aliases as follows:
  1258.  
  1259.    REP.EAT
  1260.     if nu $2
  1261.       echo;echo %<  s%>yntax: %<$0 aliasname arg1 arg2 ...^j
  1262.     else
  1263.       /repeat2 $*
  1264.     fi
  1265.  
  1266.    REPEAT2
  1267.     fi
  1268.     $1 $2
  1269.     if ~nu $3
  1270.       /$0 $1 $-2
  1271.  
  1272. If there is not at least one argument after the name of the command, aì
  1273. syntax message is given.  Otherwise a series of operations using REPEAT2ì
  1274. begins in which the command is executed on the first argument, and thenì
  1275. REPEAT2 is reinvoked with the same command name but with one argumentì
  1276. stripped from the list of arguments.  Note that the parameter $-2 is used. ì
  1277. The first parameter (the command verb) is given explicitly as $1.  "$-2"ì
  1278. strips away the verb and the argument that has already been processed.  Theì
  1279. expression "$1 $-2" allows one to strip out the second token.  Similarly,ì
  1280. "$1 $2 $-3" would strip out the third token.  "$1 $-3" would strip out theì
  1281. second and third tokens, leaving the first one intact and moving theì
  1282. remaining tokens down by two.
  1283.  
  1284.                              Configuring ARUNZ
  1285.  
  1286.      There are several configuration options that allow the user to tailorì
  1287. the way ARUNZ operates.  The COM file is designed to make it easy to patchì
  1288. in new values for most of the options using a program like ZPATCH.
  1289.  
  1290.  
  1291. Execution Address for ARUNZ
  1292.  
  1293.      ARUNZ is written as a type-3 ZCPR33 program.  In other words, it canì
  1294. automatically be loaded to and execute at an address other than 100H.  Inì
  1295. this way, its invocation as an extended command processor can leave most ofì
  1296. the TPA (transient program area) unaffected by its operation.  In the LBRì
  1297. file posted on RASs there are generally two versions of ARUNZ, one designedì
  1298. to run at 100H (and usable in ZCPR30 systems) and one designed to run atì
  1299. 8000H.  Sometimes there are also REL files that the user can link with theì
  1300. ZCPR libraries to run at any desired address.
  1301.  
  1302.  
  1303. Display Control
  1304.  
  1305.      There are two bytes just after the standard ZCPR3 header at offset 0DHì
  1306. in the COM file (just before the string "REG") that control the display ofì
  1307. messages to the user during operation of ARUNZ.  The first byte applies whenì
  1308. ARUNZ has been invoked under ZCPR33 as an extended command processor; theì
  1309. second applies to manual invocation (or any use under ZCPR30).
  1310.  
  1311.      Each bit of these two bytes could control one display feature.  Atì
  1312. present, only six of the bits are used.  Setting a bit causes the messageì
  1313. associated with the bit to be displayed; resetting the bit supresses theì
  1314. display of the corresponding message.
  1315.  
  1316.      The least significant bit (bit 0) affects the program signon message. ì
  1317. The usual setting is 'off' for ECP invocations and 'on' for manualì
  1318. invocations.  Bit 1 affects the display of a message of the form 
  1319.  
  1320.     Running alias "XXX"
  1321.  
  1322. This message is normally displayed only for manual invocations of ARUNZ.
  1323.  
  1324.      Bit 2 controls the display of the "ALIAS.CMD file not found" message. ì
  1325. This message should generally be enabled, since it will not appear unlessì
  1326. something has unexpectedly gone wrong, and you might as well know about it.
  1327.  
  1328.      Bit 3 controls the display of a message of the form
  1329.  
  1330.     Alias "XXX" not found
  1331.  
  1332. This message is normally turned on for manual invocations only.  When theì
  1333. alias is not found by ARUNZ operating as a ZCPR33 ECP, control is turnedì
  1334. over to the error handler, and there is no need for such a message.  Theì
  1335. message can alternatively be generated, in whatever form the user desires,ì
  1336. using a default alias as described earlier.  In that case, however, theì
  1337. message will appear for ECP as well as manual invocations.
  1338.  
  1339.      Bits 4 and 5 apply only when ARUNZ has been invoked as an extendedì
  1340. command processor, and they were included as a debugging aid while I wasì
  1341. first developing ARUNZ.  Both are normally turned off.  If bit 4 is set,ì
  1342. ARUNZ will display the message "extended command processor error" if itì
  1343. could not process the alias during an ECP invocation.  Bit 5 controls aì
  1344. message of the form "shell invocation error".  It is possible (though veryì
  1345. tricky and not recommended) for an alias to serve as a shell.  If ARUNZì
  1346. fails to find an alias when invoked as a shell processor, then this messageì
  1347. will be displayed if bit 5 is set.
  1348.  
  1349.  
  1350. Locating the ALIAS.CMD File
  1351.  
  1352.      There are several possibilities for how ARUNZ is to go about locatingì
  1353. the ALIAS.CMD file.  There are four configuration blocks near the beginningì
  1354. of the ARUNZ.COM file; they are marked by text strings "PATH", "ROOT",ì
  1355. "SCANCUR", and "DU".  If the byte after "PATH" is a zero, then ARUNZ willì
  1356. look in the specific drive and user areas indicated by the two bytesì
  1357. following the string "DU".  The first byte is for the drive and has a valueì
  1358. of 0 for drive A, 1 for B, and so on.  The second byte has the user numberì
  1359. (00H to 1FH).
  1360.  
  1361.      If the byte after the string "PATH" is not zero, then some form of pathì
  1362. search will be performed depending on the settings of the bytes after theì
  1363. strings "ROOT" and "SCANCUR".  If the byte after "ROOT" is zero, then theì
  1364. entire ZCPR3 path will be searched.  If the byte after "SCANCUR" is nonzero,ì
  1365. then the currently logged drive and user will be included at the beginningì
  1366. of the path.  If the byte after "ROOT" is nonzero, then only the rootì
  1367. directory (last directory specified in the path) will be searched, and theì
  1368. byte after "SCANCUR" is ignored.
  1369.  
  1370.      My general recommendation is to use either the root of the path or aì
  1371. specified DU, especially when ARUNZ is being used as the extended commandì
  1372. processor.  It can take a great deal of time to search the entire pathì
  1373. including the current directory.  With ARUNZ as the ECP this will be doneì
  1374. every time you make a typing mistake in the entry of a command name, and theì
  1375. extra disk accesses can get quite tedious and annoying.
  1376.  
  1377.  
  1378. Use Register for Path Control
  1379.  
  1380.      There is an alternative way to control the path searching options thatì
  1381. can give one the best of all possible worlds.  After the string "REG" oneì
  1382. can patch in a value of a user register, the value of which will be used toì
  1383. specify the path search options PATH, ROOT, and SCANCUR instead of the fixedì
  1384. configuration bytes described above.
  1385.  
  1386.      Any one of the full set of 32 ZCPR3 registers can be specified for thisì
  1387. function by patching in a value from 00H to 1FH.  If any other value isì
  1388. used, the fixed configuration bytes will be used.  If a valid register isì
  1389. specified, its contents are interpreted as follows:
  1390.  
  1391.     bit 0        PATH flag (0 = use fixed DU; 1 = use path)
  1392.     bit 1        ROOT flag (0 = use entire path; 1 = use root only)
  1393.     bit 2        SCANCUR flag (0 = use path only; 1 = include
  1394.                 current DU)
  1395.  
  1396. By changing the value stored in the specified register, one can change theì
  1397. way ARUNZ looks for the ALIAS.CMD file dynamically depending on theì
  1398. circumstances.
  1399.  
  1400.  
  1401.                             Plans for the Future
  1402.  
  1403.      I don't have much writing stamina left, but I would like to finish withì
  1404. a few comments about developments I would still like to see in ARUNZ.  A fewì
  1405. were mentioned in the main text above.  There is a need for some additionalì
  1406. parameters, such as register values in various decimal formats.  One alsoì
  1407. needs more flexible access to the directory specification part of a token. ì
  1408. The present parameters only allow extracting a DU reference, and they don'tì
  1409. allow any way to tell if an explicit directory is specified.  There shouldì
  1410. be a parameter that returns whatever DU or DIR string (including the colon)ì
  1411. is present.  If none is present, the parameter should return a null string.
  1412.  
  1413.      One of the things hampering the additional of more parameters is theì
  1414. arcane form they presently take.  I would like to find a much more rationalì
  1415. system (and if you have any suggestions, I would love to hear them).  I amì
  1416. thinking of something like $S for system file, followed by 'F', 'N', or 'T'ì
  1417. and then a number 0..3.  Thus $ST2 would read Systemfile-Type-2.  Commandì
  1418. line tokens might be $T followed by 'D', 'U', 'P', 'F', 'N', or 'T' and thenì
  1419. a digit 0..9 or 1..9.  The 'P' option (path) would be the DU or DIR prefix,ì
  1420. if any, including the colon.  Problem: what letter do I use for the namedì
  1421. directory or the path without the colon?  The logical choices 'N' and 'D'ì
  1422. are already used.  Maybe I have to go to four letters: $T for token,ì
  1423. followed by 'D' for directory part or 'F' for file part.  The 'D' could beì
  1424. followed by various letters (again, I am not sure what to use for all ofì
  1425. them) to indicate:
  1426.  
  1427.     1) the equivalent drive or default if none specified
  1428.     2) the equivalent drive or null string if none specified
  1429.     3) the same two possibilities for the user number
  1430.     4) the equivalent or given named directory (but what if the
  1431.        directory has no name)
  1432.     5) the whole directory prefix as given either including or not
  1433.        including the colon
  1434.  
  1435. Similarly, the 'F' option could be followed by a letter to indicate theì
  1436. whole filename, the name only, or the type only.  As you can see, it is notì
  1437. easy to identify all the things one might need and find a rational way toì
  1438. express them all.
  1439.  
  1440.      It would be nice to have prompted input where the user's input could beì
  1441. used in more than one place in the command line.  User input would have toì
  1442. be assigned to temporary parameters ($U1, $U2, and so on).  Perhaps thereì
  1443. should be the possibility of specifying default values for command lineì
  1444. tokens when they are not actually given on the command line (as in ZEX).  Itì
  1445. might also be useful to be able to pull apart a token that is a list ofì
  1446. items separated by commas.
  1447.  
  1448.      ARUNZ could use better error reporting for badly formed scripts.  Atì
  1449. present one just gets a message that there was an error in the script, butì
  1450. there is no indication of what or where the error was.  Ideally, theì
  1451. interpreted line should be echoed to the screen with a pointer to theì
  1452. offending symbol (NZEX has this).
  1453.  
  1454.      There should be an option to have ARUNZ vector control to the ZCPR3ì
  1455. error handler whenever it cannot resolve the alias or when there is a defectì
  1456. in the script.  At present, chaining to the error handler only occurs whenì
  1457. ARUNZ has been invoked as an ECP.
  1458.  
  1459.      An intriguing possibility is to allow alias name elements to be regularì
  1460. expressions in the Unix (or JetFind) sense.  Then one could give an aliasì
  1461. name like "[XS]DIR" to match either XDIR or SDIR.  Perhaps there could be aì
  1462. correspondence established between non-unique expressions and a parameterì
  1463. symbol in the script.  Then all my KMD aliases might be simpler:
  1464.  
  1465.     S[P]*[K]*  kmd s$x1$x2 $*
  1466.  
  1467. The name would read as follows: 'S' followed by zero or more occurrences ofì
  1468. 'P' followed by zero or more occurrences of 'K'.  The parameter $X1, forì
  1469. example, would be the first regular expression, i.e., the 'P' if present orì
  1470. null if not.  This is fun to think about, but I am not at all sure that itì
  1471. would really be worth the trouble to use or to code for.  Any comments.
  1472.  
  1473.      It would also be nice to provide Dreas Nielsen's RESOLVE facilityì
  1474. directly in ARUNZ aliases.  These would use the percent character ('%') as aì
  1475. lead-in.  Any symbol enclosed in percent signs would be interpreted as aì
  1476. shell variable name, and its value from the shell file would be substitutedì
  1477. for it in the command line.  The parameter '$%' would be used to enter aì
  1478. real percent character.
  1479.  
  1480.  
  1481.                                  Next Time
  1482.  
  1483.      As usual, I have written much more than planned but not covered all theì
  1484. subjects planned.  I really wanted to discuss shells in more detail,ì
  1485. particularly after the fiasco with the way WordStar 4 behaves by trying toì
  1486. be a shell when it should not be.  That will have to wait for next time, Iì
  1487. am afraid.  Also by next time I should be ready to at least begin theì
  1488. discussion of ZEX.
  1489.