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 / SH.HQP / SH.HLP
Text File  |  2000-06-30  |  13KB  |  420 lines

  1. ;
  2.  
  3.            SH - A Named Variable Shell for ZCPR3
  4.  
  5.  
  6.      -- The Shell SH --       -- Handling Shell Variables --
  7.      S - The SH Command                D - SHDEFINE
  8.      C - SH Concept                    V - SHVAR
  9.      P - Potential Probs
  10.                                    -- SH Variable File --
  11.                                        F - SHFILE
  12.  
  13.  
  14. :S
  15.  
  16. Command:  SH 1.0
  17.  
  18. Syntax:
  19.  
  20.      SH
  21.  
  22. Function:
  23.  
  24.      S╚ i≤ ß NameΣ Variablσ Shel∞ fo≥ ZCPR3«  I⌠ prompt≤ thσ ì
  25. use≥á fo≥ ß commanΣ line¼á perform≤ aε interpretatioε oε thσ ì
  26. commanΣ line¼ anΣ eithe≥ execute≤ thσ commanΣ linσ itselµ o≥ ì
  27. passes the line on to the ZCPR3 Command Processor.
  28.  
  29. Options:
  30.  
  31.      None
  32.  
  33.  
  34. Comments:
  35.                                                              Variables
  36.      S╚á permit≤á thσá use≥ t∩á usσá NameΣá Variables¼á likσ ì
  37. MYFILE¼á whicΦ arσ expandeΣ iε ß manne≥ simila≥ t∩ macro≤ iε ì
  38. hi≤ commanΣ lines«á  Tw∩ programs¼ SHDEFIN┼ anΣ SHVAR¼ allo≈ ì
  39. thσá use≥á t∩ dynamicall∙ creatσ NameΣá Variables¼á anΣá thσ ì
  40. SHFIL┼á commanΣá allow≤á NameΣ Variablσá definition≤á t∩á bσ ì
  41. grouped into sets of variables.
  42.  
  43.      ┴á conventiona∞ CP/═ commanΣ linσ coulΣ looδá somethinτ ì
  44. likσ this:
  45.  
  46.           ED MYFILE.TXT
  47.  
  48.      Using SH, a ZCPR3 command line like                     Variables
  49.  
  50.           ED %WORKFILE
  51.  
  52. caε bσ generated¼á and¼á a≤ S╚ substitute≤ thσ definitioε oµ ì
  53. thσá variablσ WORKFIL┼ wheε i⌠ interpret≤ thσ commanΣá line¼ ì
  54. "E─á %WORKFILEóá coulΣ bσ expandeΣ int∩ "E─á MYFILE.TXTóá iµ ì
  55. WORKFILE=MYFILE.TXT«á  B∙ changinτ thσ valuσ oµ thσ variablσ ì
  56. WORKFILE¼á thσá meaninτá oµ thσ commanΣá "E─á %WORKFILEóá i≤ ì
  57. correspondingl∙ changed.
  58.  
  59.      Oncσá S╚á i≤ invokeΣ (b∙ typinτ thσá commanΣá SH)¼á an∙ ì
  60. commanΣ typeΣ b∙ thσ use≥ i≤ passeΣ thr⌡ S╚ first¼á expandeΣ ì
  61. a≤ required¼á anΣ then¼ iµ thσ commanΣ i≤ no⌠ aε SH-residen⌠ ì
  62. command¼á thσá expandeΣ commanΣ linσ i≤ passeΣ t∩ ZCPR│á fo≥ ì
  63. processing.
  64.  
  65.      S╚á variable≤ ma∙ bσ nesteΣ t∩ an∙á depth«á  Recursion¼ ì
  66. however¼á shoulΣ bσ avoided¼ anΣ i⌠ i≤ thσ responsibilit∙ oµ ì
  67. thσ use≥ t∩ ensurσ tha⌠ recursioε doe≤ no⌠ occur.
  68.                                                              Variables
  69.      '%%ºá i≤á interpreteΣá b∙á S╚á a≤á ßá singlσá '%'«á  S╚ ì
  70. variable≤ are assigneΣ a≤ follows:
  71.  
  72.           VAR1 = "ED %%VAR2"       VAR2 = "MYFILE.TXT"
  73.  
  74. VAR1 is expanded as
  75.  
  76.           "ED %VAR2"
  77.  
  78. which is, in turn, expanded as
  79.  
  80.           "ED MYFILE.TXT"
  81.  
  82. which is finally executed by being passed to ZCPR3.
  83.  
  84.                                                              SH Commands
  85.      There are three SH-resident commands:
  86.  
  87.           SHCMT   - switch SH to run in comment mode; in
  88.                          comment mode, all lines which
  89.                          do not begin with the character
  90.                          ! are treated as comments and
  91.                          flushed
  92.           SHECHO  - with Echo enabled, all expanded command
  93.                          lines are printed to the user to
  94.                          show him what the line looked like
  95.                          after expansion
  96.           SHEXIT  - SH is popped from the Shell Stack,
  97.                          enabling the next lower Shell for
  98.                          execution
  99.  
  100.      The normal prompt for SH is:                            Comment Mode
  101.  
  102.           DU:NAME>>
  103.  
  104. as opposed to:
  105.  
  106.           DU:NAME>
  107.  
  108. fo≥á ZCPR3«á  Iµ thσ SHCM╘ (S╚ Comment⌐ facilit∙ i≤ enabled¼ ì
  109. this prompt becomes:
  110.  
  111.           DU:NAME;
  112.  
  113.      An∙á tex⌠á issueΣ b∙ thσ use≥ o≥ ß commanΣá filσá (likσ ì
  114. ZEX⌐á wil∞á bσá processeΣá a≤ ßá commen⌠á unles≤á thσá firs⌠ ì
  115. characte≥ oµ thσ linσ i≤ aε exclamatioε marδ (!)¼á whicΦá i≤ ì
  116. an indicator to process the command text that follows.
  117.  
  118.      Thσ commanΣ SHCM╘ switche≤ t∩ commen⌠ mode¼á anΣ !SHCM╘ ì
  119. switches back.
  120.                                                              Built-in Cmds
  121.      Thσá SHECH╧á commanΣá i≤ als∩ ßá toggle¼á enablinτá anΣ ì
  122. disablinτ thσ ech∩ oµ commanΣ line≤ afte≥ al∞ variable≤ havσ ì
  123. been resolved.
  124.  
  125.      Thσ SHEXI╘ commanΣ cause≤ thσ Shel∞ Stacδ t∩ bσá poppeΣ ì
  126. onσá level¼á whicΦá iεá turεá cause≤á thσá S╚á Shel∞á t∩á bσ ì
  127. terminated since it was on the top of the stack.
  128.  
  129.      BotΦá SHECH╧ anΣ SHEXI╘ caε bσ executeΣ froφ S╚ Commen⌠ ì
  130. mode by prefixing these commands with an exclamation mark.
  131.  
  132.      Thσ ┐á commanΣ (ß linσ beginninτ witΦ ß quesitoεá mark⌐ ì
  133. invoke≤á thσá built-iεá hel≡ facilit∙ oµá SH¼á whicΦá simpl∙ ì
  134. reminds the user of what the built-in commands are for SH.
  135.  
  136.                                                              Other Shells
  137.      S╚áá i≤á jus⌠á beginninτá oµá thσá ZCPR│á Shel∞áá Stacδ ì
  138. applications«  MEN╒ anΣ VFILE╥ arσ botΦ shell≤ now¼ anΣ the∙ ì
  139. executσ likσ SH«  Al∞ threσ shell≤ caε pas≤ commanΣ line≤ t∩ ì
  140. ZCPR3¼á havσá ZCPR│á executσá thesσ command≤ iεá it≤á norma∞ ì
  141. fashion¼á completσá witΦ thσ command-searcΦá hierarchy¼á anΣ ì
  142. theεá returε t∩ thσ appropriatσ shell≤ wheε done«á  ┴á Shel∞ ì
  143. impose≤á ßá ne≈ initia∞ commanΣ linσ interpretatioεá oεá thσ ì
  144. inpu⌠ commanΣ line.
  145.  
  146.  
  147. Selected Error Messages:
  148.  
  149.      "N∩ Shel∞ Stackó mean≤ tha⌠ ß Shel∞ Stacδ ha≤ no⌠á beeε ì
  150. installed in the ZCPR3 System and SH cannot run.
  151.  
  152.      "Shel∞á Stacδ Fulló mean≤ tha⌠ therσ i≤ no⌠ enougΦ rooφ ì
  153. on the Shell Stack for SH to push itself and SH cannot run.
  154.  
  155.      "Shel∞á Stacδá Entr∙ Sizeó mean≤ tha⌠ thσá shel∞á stacδ ì
  156. entrie≤á arσá to∩ shor⌠ fo≥ S╚ t∩ definσ thσá parameter≤á i⌠ ì
  157. needs to control its operation.  SH cannot run.
  158.  
  159. Examples of Use:
  160.  
  161.      SH
  162.           -- SH is invoked
  163.  
  164. :D
  165.  
  166. Command:  SHDEFINE 1.0
  167.  
  168. Syntax:
  169.  
  170.      SHDEFINE ufn        <-- define variables within file
  171. or
  172.      SHDEFINE            <-- define variables within SH.VAR
  173.  
  174. Function:
  175.  
  176.      SHDEFIN┼á allow≤ thσ use≥ t∩ interactivel∙ displa∙á anΣ ì
  177. edi⌠á thσ assignmen⌠ oµ variable≤ iε ß Shel∞ Variablσá file«  ì
  178. Hσ ma∙ add¼á delete¼ anΣ redefinσ Shel∞ Variable≤ a≤ wel∞ a≤ ì
  179. lis⌠ al∞ curren⌠ definition≤ oε thσ CR╘ o≥ prin⌠ theφ oε thσ ì
  180. printer.
  181.  
  182. Options:
  183.  
  184.      None
  185.  
  186. Comments:
  187.  
  188.      Usσ oµ SHDEFIN┼ i≤ explaineΣ withiε thσ prograφ itself«  ì
  189. I⌠á i≤ menu-driveε anΣ thσ erro≥ anΣ instructiona∞á message≤ ì
  190. arσ intended to be clear.
  191.  
  192.      Thσá mos⌠ comple° commanΣ i≤ thσ ┼ (fo≥ Edit⌐á command«  ì
  193. Afte≥á issuinτá thi≤ command¼á thσ use≥ i≤á prompteΣá fo≥á ß ì
  194. variablσá name«á  Iµ hσ give≤ thσ namσ oµ ß variablσ no⌠ ye⌠ ì
  195. defined¼á thσá use≥ i≤ prompteΣ fo≥ ßá definition¼á anΣá thσ ì
  196. variablσ i≤ s∩ defineΣ unles≤ thσ use≥ respondeΣ witΦ jus⌠ ß ì
  197. RETUR╬á a⌠á thi≤á point«á  Iµ thσ namσ oµ thσá variablσá ha≤ ì
  198. alread∙á beeεá defined¼á thσ use≥ i≤ askeΣ iµ hσá wishe≤á t∩ ì
  199. deletσ (D⌐ o≥ redefinσ (R⌐ thσ variable«  Appropriatσ actioε ì
  200. is taken in response to the user input.
  201.  
  202.      The user must be a Wheel to run the SHDEFINE command.
  203.  
  204.  
  205. Selected Error Messages:
  206.  
  207.      Self-Explanatory
  208.  
  209. Examples of Use:
  210.  
  211.      SHDEFINE myvars
  212.           -- define variables in MYVARS.VAR
  213.  
  214. :F
  215.  
  216. Command:  SHFILE 1.0
  217.  
  218. Syntax:
  219.  
  220.      SHFILE         <-- display name of Shell Variable File
  221. or
  222.      SHFILE ufn     <-- set name of Shell Variable File
  223.  
  224. Function:
  225.  
  226.      SHFIL┼ display≤ o≥ set≤ thσ namσ oµ thσ Shel∞á Variablσ ì
  227. Filσá t∩ bσ useΣ b∙ SH«á  SHFIL┼ ma∙ bσ executeΣ whilσ S╚ i≤ ì
  228. not running if desired.
  229.  
  230. Options:
  231.  
  232.      None
  233.  
  234.  
  235. Comments:
  236.  
  237.      SHDEFIN┼á anΣ SHVA╥ definσ variable≤ t∩ bσ placeΣá int∩ ì
  238. Shel∞ Variablσ Files«á  SHFIL┼ define≤ whicΦ Shel∞á Variablσ ì
  239. File will be used by SH when it executes.
  240.  
  241.      Wheε S╚ anΣ SHVA╥ execute¼ thσ nameΣ variablσ filσ the∙ ì
  242. dea∞ witΦ reside≤ iε thσ ROO╘ directory.
  243.  
  244. Selected Error Messages:
  245.  
  246.      Self-Explanatory
  247.  
  248. Examples of Use:
  249.  
  250.      SHFILE
  251.           -- display name of Shell Variable File
  252.  
  253.      SHFILE myvars.var
  254.           -- define name of Shell Variable File
  255.  
  256. :V
  257.  
  258. Command:  SHVAR 1.0
  259.  
  260. Syntax:
  261.  
  262.      SHVAR          <-- list variables
  263. or
  264.      SHVAR var      <-- delete variable
  265. or
  266.      SHVAR var text <-- define/redefine variable
  267.  
  268. Function:
  269.  
  270.      SHVA╥á i≤ ß utilit∙ whicΦ caε lis⌠ al∞ Shel∞á Variable≤ ì
  271. iεá thσá currently-defineΣ Shel∞ Variablσ Filσ o≥ edi⌠á thi≤ ì
  272. filσ t∩ deletσ o≥ changσ onσ particula≥ variablσ a⌠ ßá time«  ì
  273. SHVA╥á i≤á sometime≤ morσ convenien⌠ t∩ usσá thaεá SHDEFINE¼ ì
  274. whicΦá i≤á intendeΣ fo≥ editinτ group≤ oµ variable≤á iεá onσ ì
  275. sitting.
  276.  
  277.  
  278. Options:
  279.  
  280.      None
  281.  
  282. Comments:
  283.  
  284.      SHVA╥ ma∙ bσ useΣ whilσ runninτ S╚ o≥ not«á  Iµ ß Shel∞ ì
  285. Variablσ Filσ i≤ alread∙ defineΣ t∩ thσ ZCPR│ System¼á SHVA╥ ì
  286. uses this file.  If one is not defined, SHVAR uses SH.VAR.
  287.  
  288.      SH.VAR is always located in the ROOT directory.
  289.  
  290.      The user must be a Wheel to run SHVAR.
  291.  
  292. Selected Error Messages:
  293.  
  294.      Self-Explanatory
  295.  
  296.  
  297. Examples of Use:
  298.  
  299.      SHVAR
  300.           -- list shell variables
  301.  
  302.      SHVAR VAR2
  303.           -- delete the variable VAR2
  304.  
  305.      SHVAR VARX THIS IS A TEST
  306.           -- define VARX to "THIS IS A TEST"
  307.  
  308. :C
  309.  
  310.                          SH Concept
  311.  
  312.      Oncσá S╚á i≤ invokeΣ (b∙ typinτ thσá commanΣá SH)¼á an∙ ì
  313. commanΣ typeΣ b∙ thσ use≥ i≤ passeΣ thr⌡ S╚ first¼á expandeΣ ì
  314. a≤ required¼á anΣ then¼ iµ thσ commanΣ i≤ no⌠ aε SH-residen⌠ ì
  315. command¼á thσá expandeΣ commanΣ linσ i≤ passeΣ t∩ ZCPR│á fo≥ ì
  316. processing.
  317.  
  318.      S╚á variable≤ ma∙ bσ nesteΣ t∩ an∙á depth«á  Recursion¼ ì
  319. however¼á shoulΣ bσ avoided¼ anΣ i⌠ i≤ thσ responsibilit∙ oµ ì
  320. thσá use≥á t∩á ensurσ tha⌠ recursioεá doe≤á no⌠á occur«á  Iµ ì
  321. recursioε doe≤ occur¼á thσ commanΣ linσ buffe≥ wil∞ overflo≈ ì
  322. and SH will abort the command line.
  323.  
  324.  
  325.      S╚á Variable≤á arσá referenceΣá iεá commanΣá line≤áá a≤ ì
  326. "%varname"¼á anΣá '%%º i≤ interpreteΣ b∙ S╚ a≤ ß singlσ '%'«  ì
  327. T∩á illustrate¼á assumσá tha⌠ S╚ variable≤ arσá assigneΣá a≤ ì
  328. follows:
  329.  
  330.           VAR1 = "ED %%VAR2"       VAR2 = "MYFILE.TXT"
  331.  
  332. The command line "%VAR1" is expanded as
  333.  
  334.           "ED %VAR2"
  335.  
  336. which is, in turn, is expanded as
  337.  
  338.           "ED MYFILE.TXT"
  339.  
  340. which is finally executed by being passed to ZCPR3.
  341.  
  342.  
  343.      Shel∞á Variablσ File≤ arσ locateΣ iε thσ ROO╘ director∙ ì
  344. for the commands SH and SHVAR.
  345.  
  346.      Thσá use≥á mus⌠á bσá ß Whee∞ iεá orde≥á t∩á edi⌠á Shel∞ ì
  347. Variablσ Files«á  Thσ command≤ SHDEFIN┼ anΣ SHVA╥ wil∞á onl∙ ì
  348. run if the user is a Wheel.
  349.  
  350.  
  351.      There are three SH-resident commands:
  352.  
  353.           SHCMT   - switch SH to run in comment mode; in
  354.                          comment mode, all lines which
  355.                          do not begin with the character
  356.                          ! are treated as comments and
  357.                          flushed
  358.           SHECHO  - with Echo enabled, all expanded command
  359.                          lines are printed to the user to
  360.                          show him what the line looked like
  361.                          after expansion
  362.           SHEXIT  - SH is popped from the Shell Stack,
  363.                          enabling the next lower Shell for
  364.                          execution
  365.  
  366.      The normal prompt for SH is:
  367.  
  368.           DU:NAME>>
  369.  
  370. as opposed to:
  371.  
  372.           DU:NAME>
  373.  
  374. fo≥á ZCPR3«á  Iµ thσ SHCM╘ (S╚ Comment⌐ facilit∙ i≤ enabled¼ ì
  375. this prompt becomes:
  376.  
  377.           DU:NAME;
  378.  
  379.      An∙á tex⌠á issueΣ b∙ thσ use≥ o≥ ß commanΣá filσá (likσ ì
  380. ZEX⌐á wil∞á bσá processeΣá a≤ ßá commen⌠á unles≤á thσá firs⌠ ì
  381. characte≥ oµ thσ linσ i≤ aε exclamatioε marδ (!)¼á whicΦá i≤ ì
  382. an indicator to process the command text that follows.
  383.  
  384.      Thσ commanΣ SHCM╘ switche≤ t∩ commen⌠ mode¼á anΣ !SHCM╘ ì
  385. switches back.
  386.  
  387.      Thσá SHECH╧á commanΣá i≤ als∩ ßá toggle¼á enablinτá anΣ ì
  388. disablinτ thσ ech∩ oµ commanΣ line≤ afte≥ al∞ variable≤ havσ ì
  389. been resolved.
  390.  
  391.      Thσ SHEXI╘ commanΣ cause≤ thσ Shel∞ Stacδ t∩ bσá poppeΣ ì
  392. onσá level¼á whicΦá iεá turεá cause≤á thσá S╚á Shel∞á t∩á bσ ì
  393. terminated since it was on the top of the stack.
  394.  
  395.      BotΦá SHECH╧ anΣ SHEXI╘ caε bσ executeΣ froφ S╚ Commen⌠ ì
  396. mode by prefixing these commands with an exclamation mark.
  397.  
  398.      Thσ ┐á commanΣ (ß linσ beginninτ witΦ ß quesitoεá mark⌐ ì
  399. invoke≤á thσá built-iεá hel≡ facilit∙ oµá SH¼á whicΦá simpl∙ ì
  400. reminds the user of what the built-in commands are for SH.
  401.  
  402. :P
  403.  
  404.                      Potential Problems
  405.  
  406.      Onl∙ onσ noteΣ probleφ exist≤ witΦ SH«á  Certaiε ZCPR3-ì
  407. residen⌠á anΣá SYSRCP-residen⌠ command≤ shoulΣá bσá avoided«  ì
  408. Thesσ command≤ include:
  409.  
  410.           GO   - because the TPA has been changed since
  411.                     the desired command executed
  412.  
  413.           SAVE - same reason
  414.  
  415.      S╚áá tend≤á t∩á bσá ßá littlσá slo≈á iεá it≤áá loading«  ì
  416. Unfortunately¼á S╚á ha≤á beeε madσ a≤ smal∞ a≤ possiblσá anΣ ì
  417. wil∞á probabl∙á continuσá t∩á takσá morσá timσá thaεá simpl∙ ì
  418. invoking the ZCPR3 command processor directly.
  419.  
  420.