home *** CD-ROM | disk | FTP | other *** search
/ ftp.barnyard.co.uk / 2015.02.ftp.barnyard.co.uk.tar / ftp.barnyard.co.uk / cpm / walnut-creek-CDROM / CPM / ZCPR33 / Z3-33 / Z33ANOTE.0Z2 / Z33ANOTE.002
Text File  |  2000-06-30  |  11KB  |  251 lines

  1.                         ZCPR33 APPLICATION NOTES
  2.  
  3. Note Number:    002
  4. Author:        Jay Sage
  5. Date:        June 8, 1987
  6.  
  7.  
  8.      Making Effective Use of ARUNZ as an Extended Command Processor
  9.                  (Especially on a Remote Access System)
  10.  
  11.  
  12.    From my recent experience using several ZCPR33 remote access systems,
  13. most sysops are not aware of the way ARUNZ can be used as an extended
  14. command processor to make the operation of their system much, much
  15. easier for their users.  Because a single 4K ALIAS.CMD file can contain
  16. hundreds of aliases, the cost in disk space to provide a highly error-
  17. tolerant environment to the user is very small.  These techniques can
  18. also be used to great advantage on a personal system to make the sytem
  19. highly tolerant of errors.
  20.  
  21.      The kinds of aliases can be grouped loosely into three categories,
  22. each of which I will cover below.  At the end I will describe a method
  23. for making these aliases execute at top speed.
  24.  
  25.  
  26. Alternate Command Forms
  27. -----------------------
  28.  
  29.      The most obvious use of aliases is to provide alternative names for
  30. commands.  We will use an example to illustrate the principle.  Consider
  31. the task of finding out if a certain file is somewhere on the system and
  32. where.  Some systems use FINDF, the original ZCPR3 program for this
  33. purpose; others use one of the standard CP/M programs (WIS or WHEREIS);
  34. and others have begun to use the new, enhanced ZSIG program called FF. 
  35. This can be very confusing to new users or to users who call many
  36. different systems.  The solution is to provide aliases for all the
  37. alternatives.  Suppose FF is the real program in use.  Then the
  38. following line in ALIAS.CMD will allow all the forms to be used equally:
  39.  
  40.     FINDF=WIS=WHEREIS ff $*
  41.  
  42. (I am following a convention of writing the alias names in upper case
  43. and the script in lower case.  This is only for ease in reading; ARUNZ
  44. is not case sensitive.)  In fact, while I am at it, I usually throw in a
  45. few other forms that someone might try and that are sufficiently
  46. unambiguous that one can guess with some confidence that this is the
  47. function the user intended:
  48.  
  49.     FIND.FILE=FILE.FIND=WIS=WHERE.IS ff $*
  50.  
  51.      Since (for ARUNZ version 0.9D and later) the characters after a
  52. period are optional-match characters (they must match only if characters
  53. are present), the first name will match FIND, FINDF, and FINDFILE (and
  54. others).  The last form will match both WHERE and WHEREIS (and others). 
  55. Note that this single alias, which occupies 40 bytes in ALIAS.CMD
  56. (including the CRLF), responds to 8 commonly used commands for finding
  57. files on a system.  Thus the cost is a mere 5 bytes per command!!
  58.  
  59.      ZCPR33 introduced the ability to bypass path searching and go
  60. straight to the extended command processor by prefixing a command with a
  61. space or slash.  As users begin to avail themselves of this feature to
  62. speed up command processing, it may happen that someone will enter the
  63. command as "/FF" or " FF", thinking that "FF" is an alias for the real
  64. command.  With the script above this will fail.  Therefore, I am now
  65. recommending including the real command as an alias for itself to cover
  66. this situation.  The final form for our file-finding alias (with an
  67. extra change thrown in to allow the short form "WH") is thus:
  68.  
  69.     FIND.FILE=FILE.FIND=WIS=WH.EREIS=FF ff $*
  70.  
  71.      I have extended the use of command aliasing even to include the
  72. results of common typing mistakes.  Richard Jacobson (Mr. Lillipute),
  73. who calls my system quite often, either has a Wyse keyboard with very
  74. bad bounce (as he claims) or is a lousy typist (and refuses to admit
  75. it).  When he wants to display a directory, his command is more likely
  76. to come out DDIR or DIRR than it is to come out correctly as DIR.  So I
  77. added those two forms to my alias, so it now reads:
  78.  
  79.     XD.IR=DDIR=DIR.R dir $*
  80.  
  81. Is seven extra bytes too much to sacrifice for a friend!
  82.  
  83.  
  84. Alternate Directory Changing References
  85. ---------------------------------------
  86.  
  87.      It is obviously very hard for users to remember the DU forms for
  88. directories on a remote system, and that is why named directories are
  89. provided.  But even names are not always easy to remember precisely. 
  90. Aliases can help by providing alternative names for logging into
  91. directories, provided ZCPR33 has been assembled with the BADDUECP option
  92. enabled so that invalid directory-change references are passed on to the
  93. extended command processor.  My system has a directory called Z3SHELLS
  94. (I think).  Since even I have trouble remembering that it is not Z3SHELL
  95. or SHELLS or SHELL, I would have a line in ALIAS.CMD that reads:
  96.  
  97.     Z3SHELL:=SHELL:=SHELLS: z3shells:
  98.  
  99.      A further problem is that users often (and I occasionally) forget
  100. to type the colon on the end.  It is very easy for ARUNZ to pick this up
  101. as well and add the colon for you.  Just include the following alias:
  102.  
  103.     Z3SHELL=Z3SHELLS=SHELL=SHELLS z3shells:
  104.  
  105. All of these aliases can be combined into the single script:
  106.  
  107.     Z3SHELL.:=Z3SHELL.S:=SHELL.:=SHELL.S: z3shells:
  108.  
  109. All seven forms are covered by an entry of 49 bytes, a cost of 7 bytes
  110. each.
  111.  
  112.      On my system I provide a complete set of aliases for all possible
  113. directories so that any legal directory can be entered with or without
  114. colons and using either the DIR of the DU form.  Thus, if Z3SHELLS is
  115. B4, the script above would be:
  116.  
  117.     Z3SHELL.:=Z3SHELL.S:=SHELL.:=SHELL.S:=B4.: z3shells:
  118.  
  119.      Before ZCPR33 came along and provided this service itself, I would
  120. allow callers to use the DU form to log into directories beyond the max-
  121. drive/max-user limits by including aliases of the above form.  If the
  122. maximum user area were 3 in the above example, the commands "B4:" and
  123. "B4" would still have worked (even under ZCPR30) because ARUNZ mapped
  124. them into a DIR form of reference.  Although this is no longer
  125. necessary, a complete alias line like the one above covers all bases. 
  126. The user can even enter any of the commands with a leading space or
  127. slash and they will still work.
  128.  
  129.      Finally, I usually provide a catch-all directory change alias to
  130. pick up directory change commands that don't even come close to
  131. something legal.  At the end of ALIAS.CMD (i.e., after all the other
  132. directory-change aliases described above, so that they get first shot) I
  133. include the line"
  134.  
  135.     ?:=??:=???:=????:=?????:=??????:=???????:=????????: echo
  136.       d%>irectory %<$0%> is not an allowed directory.  %<t%>he^m^j
  137.       valid directories are:;pwd
  138.  
  139. Thus when the user enters the command "BADDIR:", he get the PWD display
  140. of the system's directories prefixed by the message
  141.  
  142.     Directory BADDIR: is not an allowed directory.  The
  143.     valid directories are:
  144.  
  145. Note the use of Z33RCP's advanced ECHO command with case shifting ('%<
  146. to switch to upper case and '%>' to switch to lower case) and control
  147. character inclusion (caret followed by the character).
  148.  
  149.  
  150. Abbreviated Commands
  151. --------------------
  152.  
  153.      This category is closely releated to the first category described
  154. above.  Consider transferring files.  One commonly enters a command like
  155.  
  156.     KMD SK FN.FT
  157.  
  158. Of course, some systems still use XMODEM, so it is handy to have an
  159. alias (according to the first category above) that reads:
  160.  
  161.     XMODEM=KMD kmd $*
  162.  
  163. But why require the user to type KMD or XMODEM at all?  Why not allow
  164. the option letters alone.  I provide the following set of aliases so
  165. that users can invoke file transfer operations by entering the KMD
  166. option letters alone as commands (along with other forms):
  167.  
  168.     S=SEND=DOWN.LOAD kmd s $1
  169.     SK=SENDK=DOWNK kmd sk $1
  170.     SP=SENDP=DOWNP kmd sp $1
  171.     SPK=SENDPK=DOWNPK kmd spk $1
  172.     SB=SENDB=BATCH=DOWNB kmd sb $*
  173.     SBK=SENDBK=BATCHK=DOWNBK kmd sbk $*
  174.     R=REC.EIVE=UP.LOAD kmd r $1
  175.     RP kmd rp $1
  176.     L=LIBSEND=SENDL=DOWNL kmd l $1 $2
  177.     LK=LIBSENDK=SENDLK=DOWNLK kmd l $1 $2
  178.  
  179. Most of the longer alternative forms will never be used, but I decided
  180. to be a 'big spender' and squander a hundred bytes!  Many of my users
  181. (and I, myself) use the option letter alternatives -- with a leading
  182. space or slash -- all the time.  I usually spruce up the aliases with
  183. messages, so the SK alias might have a command script of:
  184.  
  185.     echo s%>ending file %<$1 (1k %>protocol);kmd sk $*
  186.  
  187. Even fancier scripts can be concocted.  One word of caution.  If you
  188. allow the 'R' and 'SP' aliases, you cannot have the reset and space
  189. commands in your RCP with the standard names.  I have them but have
  190. changed the names to 'RES' and 'SPAC' respectively.
  191.  
  192.  
  193. How to Implement ARUNZ
  194. ----------------------
  195.  
  196.      I would like to close with some tips on how to implement the scheme
  197. described above.  Setting up ARUNZ as the extended command processor is
  198. described in the ZCPR33 Users Guide and in the documentation with ARUNZ. 
  199. Basically, one renames ARUNZ.COM to CMDRUN.COM and places it in the root
  200. directory (the last one listed in the symbolic path).  ARUNZ can be
  201. configured to look for ALIAS.CMD either along the entire path, in the
  202. root directory, or in a specifically designated directory.  I recommend
  203. one of the latter two alternatives.
  204.  
  205.      The main trick I would like to call to everyone's attention is a
  206. way to make ARUNZ perform at top speed as an extended command processor. 
  207. That is to arrange your disk so that the ARUNZ.COM and ALIAS.CMD files
  208. are listed near the beginning of the disk directory and are stored near
  209. the beginning of the disk data area.
  210.  
  211.      If you are starting with a fresh diskette (or hard disk), this is
  212. easy.  Just copy these two files onto the disk first.  The question is,
  213. what do you do if the disk already has files on it?  Here is what I do. 
  214. Run DU3 and go to group 0 (command 'G0'), where the directory starts. 
  215. Note which files are at the beginning of the directory, and note which
  216. files have low group numbers allocated to them.
  217.  
  218.      To make things concrete, suppose we find two unimportant files
  219. called NOTIMP1 and NOTIMP2 that meet these requirements and consume
  220. enough allocation groups to accommodate ARUNZ.COM and ALIAS.COM.  First
  221. we have to get these files out of the way.  We do this by copying them
  222. to new names with commands like:
  223.  
  224.     PPIP NOTIMP1A=NOTIMP1;GO NOTIMP2A=NOTIMP2
  225.  
  226. (If they are in different user areas, then we include the user numbers
  227. in the commands.)  Then we erase the original files to free up the
  228. directory and disk space:
  229.  
  230.     ERA NOTIMP1;ERA NOTIMP2
  231.  
  232. Next we copy ARUNZ.COM and ALIAS.COM into their place.  Suppose, to deal
  233. with the most complex case, that these files are already in the current
  234. directory and that ARUNZ.COM is already called CMDRUN.COM.  We use the
  235. following commands to move them into place:
  236.  
  237.     PPIP CMDRUN1.COM=CMDRUN.COM;GO ALIAS1.CMD=ALIAS.CMD
  238.     REN CMDRUN.COM=CMDRUN1.COM;REN ALIAS.CMD=ALIAS1.CMD
  239.  
  240. With the rename commands, we answer 'Y' when prompted about deleting the
  241. existing files.  Finally, we rename the two files that we moved out of
  242. the way:
  243.  
  244.     REN NOTIMP1=NOTIMP1A;REN NOTIMP2=NOTIMP2A
  245.  
  246. If CMDRUN.COM and/or ALIAS.CMD had previously been stored in high group
  247. numbers, you should now notice a very dramatic improvement in system
  248. response (at least when you go to the ECP directly by entering commands
  249. with a leading space or slash).  I get almost RAM-disk performance on my
  250. system.
  251.