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 / ZSYS / SIMTEL20 / ZCPR3 / SHUTILS2.LBR / SHUTILS.HZP / SHUTILS.HLP
Text File  |  2000-06-30  |  7KB  |  239 lines

  1. ;
  2.  
  3.                       SHELL UTILITIES
  4.  
  5.  
  6.  
  7.  
  8.                   I Introduction
  9.  
  10.                   R RESOLVE
  11.  
  12.                   G GETVAR
  13. :I
  14.                                                 Introduction
  15.  
  16.                        INTRODUCTION
  17.                        ============
  18.  
  19.  
  20.  
  21.  
  22. The  two  shell  utilities  described herein were created to
  23. make shell  variables  more  useful.     Previously,   shell
  24. variables  could only be created with the SHVAR and SHDEFINE
  25. commands, and could only be interpreted when  the  user  was
  26. operating inside  the SH shell.  These two utilities provide
  27. new  ways  of  both  defining   and   referring   to   shell
  28. variables.
  29.  
  30.  
  31.  
  32.  
  33.  
  34.  
  35.  
  36.  
  37.                                                 Introduction
  38.  
  39. Of   the   many  alternate  command  intefaces,  or  shells,
  40. supported by ZCPR3, SH is  the  simplest.    It  performs  a
  41. single  function  --  expansion of shell variable references
  42. -- and  nothing  else.    In  many  cases,  particularly  in
  43. turnkey  operations,  it  is  desirable  to operate inside a
  44. more  complete  environment,  such  as  (V)MENU  or  VFILER.
  45. These   environments  do  not  perform  expansion  of  shell
  46. variable  references,  however,  so  in  many   cases   this
  47. powerful capability  goes  unused.    These  utilities allow
  48. shell variables to be created  and  referenced  from  within
  49. (V)MENU  shells,  aliases,  VFILER  command  lines,  and ZEX
  50. files.
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58. :R
  59.                                                      RESOLVE
  60.  
  61.                            RESOLVE
  62.                            =======
  63.  
  64.  
  65.  
  66.  
  67. This utility will expand shell variable references  when  SH
  68. is not  the  top  shell.  It will also resolve references to
  69. other system features, such as register values, System  File
  70. names, and current disk and user designations.
  71.  
  72. The syntax is:
  73.  
  74.                 RESOLVE <command line>
  75.  
  76. where  the command line may contain a number of substitution
  77. flags.  The appropriate substitutions will be made, and  the
  78. entire    command    line    will   be   placed   into   the
  79. Multiple-Command Line in memory for immediate execution.
  80.  
  81.  
  82.                                                      RESOLVE
  83.  
  84. The substitution flags recognized by RESOLVE are:
  85.  
  86.         %<text>         -> shell variable reference
  87.         $D              -> current disk
  88.         $U              -> current user
  89.         $R<n>           -> register value, 0<=n<=9
  90.         $F<n>           -> System File name, 1<=n<=4
  91.         $N<n>           -> System File name, first 8 characters only
  92.         $T<n>           -> System File name, extension only
  93.         $|              -> multiple-command separator (;)
  94.  
  95. If either of the flag characters '%' or '$' appear twice  in
  96. succession on the line, only one will be substituted.
  97.  
  98.  
  99.  
  100.  
  101.  
  102.  
  103.  
  104.  
  105.                                                      RESOLVE
  106.  
  107. A  flag  for  a  substitute  multiple-command  separator  is
  108. provided so  that  system  variable  references  in  several
  109. succeeding commands  may  be  resolved  in  one  pass.  When
  110. using this feature, it must be kept in  mind  that  although
  111. the   memory-based   Multiple-Command   Line   may   be  200
  112. characters in length (say), a  parameter  list  of  no  more
  113. than 126  characters  may  be passed to a program.  Examples
  114. are:
  115.  
  116.     RESOLVE ECHO DIRECTORY OF $F3 --$|XDIR $F3
  117.  
  118.     RESOLVE SHVAR TEMP $F3$|SETFILE 3 %WFILE$|            <<
  119.                           RESOLVE SHVAR WFILE %%TEMP
  120.  
  121. The first example simply prints a  directory  of  all  files
  122. matching System  File  three.   The second example swaps the
  123. contents  of  System  File  three  and  the  shell  variable
  124. 'WFILE'.
  125.  
  126.  
  127.  
  128.                                                      RESOLVE
  129.  
  130. Nested  shell  variables  can  also be resolved by using the
  131. 'GO' command (if it is enabled in your system) as the  first
  132. item on  the  command  line passed to RESOLVE.  For example,
  133. if there are two shell variables defined as follows:
  134.  
  135.         Variable Name          Expansion
  136.         -------------          ---------
  137.            THIS                THAT
  138.            THAT                COULD BE ANYTHING
  139.  
  140. the command line
  141.  
  142.                 RESOLVE GO ECHO %%%THIS
  143.  
  144. will display
  145.  
  146.                 COULD BE ANYTHING
  147.  
  148.  
  149.  
  150.  
  151.                                                      RESOLVE
  152.  
  153. Options --
  154.  
  155. The only option available is help, which is exclusive.
  156.  
  157.  
  158. Quiet Operation --
  159.  
  160. RESOLVE obeys  the  quiet  flag,  and  will  not  print  its
  161. sign-on message if the flag is set.
  162.  
  163.  
  164. Program Error Code --
  165.  
  166. RESOLVE  clears the Program Error Code byte upon invocation,
  167. and will set it if there is a syntax error  in  the  command
  168. line.  The following are examples of syntax errors:
  169.  
  170.                 '$G' '$F8' '$4'
  171.  
  172. :G
  173.                                                       GETVAR
  174.  
  175.                           GETVAR
  176.                           ======
  177.  
  178. This  utility  will  print  a  user-defined prompt, accept a
  179. line  of  input,  and  assign  that  line  of  input  to   a
  180. user-defined shell variable.  The syntax of invocation is:
  181.  
  182.                 GETVAR <varname> <prompt text>
  183.  
  184. Only  the  first  eight  characters of the variable name are
  185. significant.    The   prompt   text    will    be    printed
  186. left-justified on  the  console,  followed  by a space.  The
  187. user's response will be entered at this point.
  188.  
  189.  
  190.  
  191.  
  192.  
  193.  
  194.  
  195.  
  196.                                                       GETVAR
  197.  
  198. Shell variables created with GETVAR have two  features  that
  199. those created with SHVAR do not.
  200.  
  201.     o   Shell  variable text may be lowercase (names will be
  202.         uppercase).
  203.  
  204.     o   Shell variable text may be a  Multiple-Command Line.
  205.  
  206. The  first of these features may be useful when non-standard
  207. utilities  are  used  to  retrieve  and  display   a   shell
  208. variable.  A command such as
  209.  
  210.                 ECHO %<varname>
  211.  
  212. will   always   result  in  a  capitalized  display  of  the
  213. variable.
  214.  
  215. The second of these  features  has  potentially  many  uses,
  216.  
  217.  
  218.  
  219.                                                       GETVAR
  220.  
  221. giving   shell   variables   almost  the  power  of  aliases
  222. (remember  that  references  to  shell  variables   may   be
  223. nested).
  224.  
  225. GETVAR  does  not check to see that the user is a Wheel, but
  226. does provide a 'secure' input editor.   That  is,  the  user
  227. cannot  abort  the  program  by  striking a control-C at the
  228. beginning of the input line.  The program may  therefore  be
  229. suitable  for  use  in  secure systems, although a malicious
  230. user who can invoke the program at will could still  corrupt
  231. the SH.VAR file.
  232.  
  233. GETVAR  abides  by the Quiet Flag, except for the display of
  234. error messages, and will set the Program Error Code byte  if
  235. it is unable to create or write the shell variable file.
  236.  
  237. The   only  option  supported  is  the  display  of  a  help
  238. message.
  239.