home *** CD-ROM | disk | FTP | other *** search
/ The C Users' Group Library 1994 August / wc-cdrom-cusersgrouplibrary-1994-08.iso / vol_100 / 185_01 / hsh.doc < prev    next >
Text File  |  1985-08-21  |  10KB  |  331 lines

  1.         HSH.DOC    Version 1.1  6 Oct 85                   Page 1
  2.  
  3.  
  4.         Copyright 1985  Michael M Rubenstein
  5.  
  6.         This software and the accompanying documentation may be
  7.         distributed freely for noncommercial use.
  8.  
  9.  
  10.  
  11.         Credits.
  12.  
  13.         ZCPR3 is a trademark of Richard L. Conn.
  14.  
  15.         CP/M is a trademark of Digital Research Incorporated.
  16.  
  17.         WordStar is a trademark of Micropro International Corporation.
  18.  
  19.         C/80 is a trademark of The Software Toolworks.
  20.  
  21.  
  22.  
  23.         Modifications.
  24.  
  25.         1.1       Fixed handling of wrap around when the history is full.
  26.  
  27.  
  28.  
  29.         Description.
  30.  
  31.         HSH is a history processing ZCPR3 shell.  It provides the ability
  32.         to recall and edit previous commands and allows much more
  33.         sophisticated editing than is found in the normal CP/M or ZCPR3
  34.         command processor.
  35.  
  36.         For example, with HSH if the command
  37.  
  38.                   mcpy b:=*.dat
  39.  
  40.         is typed and one notices that the command should have been
  41.         "mcopy", one can simply move the cursor back to the "p" and
  42.         insert an "o".  If the command is entered and an error message
  43.         received, the command can be recalled and edited in the same
  44.         manner.
  45.  
  46.         Unlike many other shells, HSH is intended to be a normal
  47.         operating environment.  Therefore, it generates no noise unless
  48.         it's special features are invoked.  For the most part, the user
  49.         sees the same results as if HSH were not present.
  50.  
  51.         HSH operates best in conjunction with a ram disk or a high speed
  52.         hard disk.  Those with slower disks are likely to find response
  53.         lethargic with HSH present.
  54.  
  55.  
  56.  
  57.         Requirements.
  58.  
  59.  
  60.  
  61.  
  62.  
  63.  
  64.  
  65.  
  66.  
  67.         HSH.DOC    Version 1.1  6 Oct 85                   Page 2
  68.  
  69.  
  70.         HSH requires ZCPR3 with external command line and shell stack.
  71.         The current version requires a video terminal which automatically
  72.         wraps lines and which allows backspacing from column one to the
  73.         end of the previous line.  About 8K of disk space is required for
  74.         the program.  The history file requires 384 bytes plus 256 bytes
  75.         per history line being kept.  The default of 10 history lines
  76.         requires 4K disk space.  The program and history file should be
  77.         on a ram disk or high speed hard disk for best results.
  78.  
  79.  
  80.  
  81.         Running HSH.
  82.  
  83.         Before running HSH, it must be installed with Z3INS in the same
  84.         way as any other ZCPR3 utility.
  85.  
  86.         HSH is run with the command
  87.  
  88.                   hsh
  89.  
  90.         One operand, the number of history lines to keep (from 0 through
  91.         100) may be included, e.g.,
  92.  
  93.                   hsh 50
  94.  
  95.         If no operand appears on the command line, HSH will use the value
  96.         from the history file, HSH.VAR, or 10 if there is no history
  97.         file.  This allows one to exit HSH and return without loosing the
  98.         history.  If a numeric operand does appear, a new history file
  99.         will be created (the old will be deleted) and any previous
  100.         history will be lost.
  101.  
  102.         If there is no problem, HSH will install itself and display a
  103.         sign on message.  HSH may be started from a submit file, in which
  104.         case the submit file will complete before HSH actually takes
  105.         control.
  106.  
  107.         HSH searches for itself (by whatever name it is called) along the
  108.         current path.  Normally the current directory is not searched
  109.         unless it is explicitly included on the path.  This may be
  110.         changed by patching the byte at 010Bh to nonzero.
  111.  
  112.         HSH puts the history file on the "root" directory -- the last
  113.         directory in the search path.  For best results, the "root"
  114.         directory and the copy of HSH that it finds in searching for
  115.         itself should both be on a ram disk.  I use a path like
  116.  
  117.                   RAMDISK $$ ROOT RAMDISK
  118.  
  119.         so critical programs are found on the ram disk first.  Note that
  120.         the "root" directory with this path is RAMDISK, not ROOT.
  121.  
  122.         The HSH prompt looks exactly like the usual ZCPR3 prompt.
  123.         Commands may be typed and will be executed normally.  The only
  124.         exceptions are the SAVE, GET, GO, and JUMP commands.  These will
  125.  
  126.  
  127.  
  128.  
  129.  
  130.  
  131.  
  132.  
  133.         HSH.DOC    Version 1.1  6 Oct 85                   Page 3
  134.  
  135.  
  136.         not give the desired effect if entered as single commands at the
  137.         prompt because HSH is in the TPA.  For example, the sequence
  138.  
  139.                   A0>ddt test.com
  140.                   A0>save 16 newtest.com
  141.  
  142.         will result in the first 16 pages of HSH being saved.  To get the
  143.         desired effect, one must plan ahead and type multiple commands
  144.  
  145.                   A0>ddt test.com;save 16 newtest.com
  146.  
  147.         which works since HSH does not regain control between the two
  148.         commands.
  149.  
  150.         HSH recognizes two characters as special if they appear as the
  151.         first character of a typed line.   Both are recognized
  152.         immediately (i.e., no carriage return is necessary).
  153.  
  154.              <ESC> -   (Escape key).  Exit HSH.
  155.  
  156.              ^C    -   (Control C).  Warm boot.  Same as the standard
  157.                        CP/M or ZCPR2 ^C.
  158.  
  159.         Entering commands in HSH is similar to doing so in the standard
  160.         command processor, but there are numerous additional editing
  161.         options.  These have been patterned (a bit loosely in a few
  162.         places) after the WordStar editing commands.
  163.  
  164.              ^A    -   Back one word
  165.  
  166.              ^D    -   Forward one character.
  167.  
  168.              ^F    -   Forward one word.
  169.  
  170.              ^G    -   Delete current character.
  171.  
  172.              ^H    -   (Backspace).  Delete previous character.
  173.  
  174.              ^J    -   Display edit command help message and resume
  175.                        editing line.
  176.  
  177.              ^P    -   Remove any special meaning from the next
  178.                        character.  For example, ^P^H inserts a ^H
  179.                        (backspace) into the line.
  180.  
  181.              ^Q    -   Back one command.
  182.  
  183.              ^R    -   Forward one command.
  184.  
  185.              ^S    -   Back one character without deleting.
  186.  
  187.              ^T    -   Delete to beginning of next word.
  188.  
  189.              ^U    -   Delete entire line.
  190.  
  191.  
  192.  
  193.  
  194.  
  195.  
  196.  
  197.  
  198.  
  199.         HSH.DOC    Version 1.1  6 Oct 85                   Page 4
  200.  
  201.  
  202.              ^V    -   Insert a character.
  203.  
  204.              ^W        Delete to beginning of previous word.
  205.  
  206.              ^Y    -   Delete to end of line.
  207.  
  208.              ^Z    -   Delete current command.  If the cursor is on a
  209.                        semicolon, the command to the right will be
  210.                        deleted.
  211.  
  212.         The command will be processed when RETURN or ENTER is pressed.
  213.         The cursor need not be at the end of the line.
  214.  
  215.         The real power of HSH, however, is in the ability to recall and
  216.         edit previous command lines.  This is controlled by several
  217.         additional command keys:
  218.  
  219.              ^E    -   Recall previous command line.  Repeated
  220.                        application gets successively earlier command
  221.                        lines.  If there is no previous command line (or
  222.                        it has not been kept in the history), the bell
  223.                        will sound.  The ^U editing command resets the
  224.                        internal pointer to the end so the next ^E gets
  225.                        the last command line executed again.
  226.  
  227.              ^L    -   Searches for a previous command line which matches
  228.                        the current line to the left of the cursor.  Case
  229.                        is immaterial.  If none is found, the bell will
  230.                        sound.  For example, if the previous command lines
  231.                        were
  232.  
  233.                                  dir
  234.                                  ws test.doc
  235.                                  type whatever.c
  236.                                  whatever;type what.out
  237.                                  ws what.out
  238.                                  dir
  239.  
  240.                        then typing "w^L" would recall the command
  241.                        "ws what.out".  The cursor is left after the "w",
  242.                        so typing "^L" again would recall
  243.                        "whatever;type what.out".  If "ws^L" were typed
  244.                        initially, the "whatever" command would be skipped
  245.                        and the two "ws" commands would be recalled.
  246.  
  247.              ^X    -   Recalls the next command (assuming a previous
  248.                        command has been recalled with ^E and is being
  249.                        edited).  If there is no next command, deletes
  250.                        the current line.
  251.  
  252.         While the editing commands may seem a bit complex at first, a
  253.         little playing at the terminal will make them very natural and
  254.         easy to use.  The ^L command, in particular, is quite different
  255.         from the commands found in most editors.  With a very little
  256.         practice, command line editing with HSH becomes almost automatic
  257.  
  258.  
  259.  
  260.  
  261.  
  262.  
  263.  
  264.  
  265.         HSH.DOC    Version 1.1  6 Oct 85                   Page 5
  266.  
  267.  
  268.         and one soon wonders how one lived without it.
  269.  
  270.  
  271.  
  272.         For the Hacker.
  273.  
  274.         HSH was written in C and compiled with the Software Toolworks
  275.         C/80 compiler using a private run time library.  Source code is
  276.         included for informational purposes.  It will not be trivial to
  277.         convert to use the standard C/80 library or any other C compiler.
  278.         Anyone interested is welcome to try, but I cannot provide much
  279.         assistance.
  280.  
  281.         <End of Document>
  282.  
  283.  
  284.  
  285.  
  286.  
  287.  
  288.  
  289.  
  290.  
  291.  
  292.  
  293.  
  294.  
  295.  
  296.  
  297.  
  298.  
  299.  
  300.  
  301.  
  302.  
  303.  
  304.  
  305.  
  306.  
  307.  
  308.  
  309.  
  310.  
  311.  
  312.  
  313.  
  314.  
  315.  
  316.  
  317.  
  318.  
  319.  
  320.  
  321.  
  322.  
  323.  
  324.  
  325.  
  326.  
  327.  
  328.  
  329.  
  330.  
  331.