home *** CD-ROM | disk | FTP | other *** search
/ Club Amiga de Montreal - CAM / CAM_CD_1.iso / files / 509.lha / CShell_v5.13 / csh.doc.pp / csh.doc
Encoding:
Text File  |  1991-05-07  |  82.0 KB  |  2,472 lines

  1.  
  2.         INSTRUCTIONS FOR SHELL VERSION: 5.11  11-Apr-1991
  3.         =================================================
  4.  
  5.   Contents
  6.   --------
  7.  
  8.     O.    Installation
  9.     I.    Description
  10.     II.    Overview of Major features
  11.     III.    Restrictions
  12.     IV.    PIPES
  13.     V.    Command Pre-processor
  14.     VI.    Command Line Editing
  15.     VII.    Function Keys
  16.     VIII.    Shell Commands
  17.     IX.    Special Set Variables
  18.     X.    Functions
  19.     XI.    Miscellaneous
  20.     XII.    Example source files
  21.     XIII.    Default values
  22.     XIV.    Object oriented features
  23.     XV.    Keymaps
  24.  
  25.  
  26.  
  27. O.  Installation
  28. ----------------
  29.  
  30. You  can  simply  invoke  csh  from  the  command  line or at the end of your
  31. startup-sequence,  because  csh  is, from the AmigaDOS standpoint, not a true
  32. shell  like  l:shell-seg.   Nevertheless,  csh is 'pure', so if your archiver
  33. forgot to set the 'p' bit, do it right now.
  34.  
  35. Proposed final setup:  If you want to make csh resident, do the following:
  36.  
  37. Kickstart 1.3
  38. 1. Copy csh anywhere on your (hard)disk, e.g. dh1:tools
  39. 2. Make sure your s:startup-sequence contains:
  40.     Resident CLI L:Shell-Seg SYSTEM PURE ADD
  41.     Resident dh1:tools/csh ADD
  42.     NewShell
  43.     EndCLI
  44. 3. Put the following in s:shell-startup
  45.     Stack 8000
  46.     csh -r s:firstlogin.sh
  47. 4. In s:firstlogin.sh, put any commands to be called only once, like setmap,
  48.    assign, setclock. This is a shell script, use # for comments, and don't
  49.    use .key type commands. At the end of this file, add
  50.     source s:login.sh
  51. 5. In s:login.sh, you put any commands that need to be executed on every
  52.    invocation, like 'alias', 'set' and so on.
  53. 6. Put the following the s:cli-startup and s:shell-startup, so csh will be
  54.    started in any window opened by NewCLI or from workbench.
  55.     csh s:login.sh
  56.  
  57. Kickstart 2.0
  58. 1. Copy csh anywhere on your (hard)disk, e.g. dh1:tools
  59. 2. Make sure your s:startup-sequence contains:
  60.     Stack 8000
  61.     Resident dh1:tools/csh ADD
  62.     csh s:firstlogin.sh
  63. 3. Proceed from step 4 in kickstart 1.3
  64.  
  65.  
  66. Additionally,  I  recommend  to  assign CSH:  somewhere and put your docs and
  67. CShell  scripts there.  You can do the assign from inside the shell, it's not
  68. needed at startup.
  69.  
  70.  
  71. I.  DESCRIPTION
  72. ---------------
  73.  
  74. This version of Shell is the successor of:
  75.     Shell V2.04 (C)Copyright 1986, Matthew Dillon, All Rights Reserved
  76.     Shell V2.04M-V2.07M by Steve Drew
  77.     Shell V2.08MI, V3.xxA and V4.xxA by Carlo Borreo & Cesare Dieni
  78.     Shell V5.xxL by U. Dominik Mueller
  79.  
  80. If you have any wishes, bug reports or beer bottles, send them to:
  81.  
  82.        FIDONET :  AUGL BBS, 2:302/906
  83.        INTERNET:  umueller@iiic.ethz.ch
  84. or
  85.        U. D. Mueller
  86.        Schulhausstrasse 83
  87.     CH-6312 Steinhausen
  88.        SWITZERLAND
  89.  
  90. Any sign of intelligent life welcome!
  91.  
  92. Please  check the 'restrictions' and 'known bugs' paragraphs before reporting
  93. any  bugs.  The support BBS is AUGL, +41 75 8 20 19, +41 75 8 20 18, +41 75 2
  94. 15 87 (all lines USRobotics HST) login='cshell', password='support'
  95.  
  96. For  versions prior to 5.00 send suggestions/criticism/anything else to Carlo
  97. Borreo or Cesare Dieni at:
  98.  
  99.        BITNET:  PERUGIA@ICNUCEVM.BITNET
  100.        FIDONET: 2:332/602.0@FIDONET
  101. or
  102.        Carlo Borreo            Cesare Dieni
  103.        Via G. Berio 34        Via G. Taddei 3
  104.        I-18100 Imperia        I-56100 Pisa
  105.        Italy            Italy
  106.  
  107. You may distribute this program unmodified and for non-profit only.
  108.  
  109. *** YOU MAY NOT MODIFY THIS PROGRAM AND REDISTRIBUTE IT ***
  110.  
  111. If  everyone  writes his own version of Shell and distributes it, we would be
  112. covered  by  Shell  versions.   If  you make a modification to Shell that you
  113. would  like  to  share  with  other users, please send us a DIFF output, or a
  114. description of what you need.
  115.  
  116. CREDITS
  117. -------
  118.  
  119. Arexx is a program by William Hawes.
  120. Cygnus Ed Professional (C) 1988 CygnusSoft Software.
  121.  
  122. Many  thanks  to  all  who  gave  me  feedback, namely Eddy Carroll, Patrizio
  123. Rusconi,  Allard  Siemelink,  Magnus  Heldestad,  Roddi Walker, Roy Haverman,
  124. Steve  Koren,  Randell  Jesup,  Peter  Orbaek and the unknown Swedish guy who
  125. found the double-LF bug for me.
  126.  
  127.  
  128. II. OVERVIEW
  129. ------------
  130.  
  131. Shell  provides a convenient AmigaDos alternative command interface.  All its
  132. commands  are  internal  and  thus  does not rely on the c:  commands for any
  133. functionality.
  134.  
  135. Major features include:
  136.     - command line editing
  137.     - simple history
  138.     - piping
  139.     - aliases with arguments
  140.     - variables & variable handling (embedded variables)
  141.     - file name expansion via wild carding ('?', '*' and more)
  142.     - conditionals (if/else etc..)
  143.     - source files  (w/ gotos and labels)
  144.     - tab file name completion
  145.     - object oriented features (file classes, actions)
  146.     - many built in commands to speed things up
  147.     - full functionality on VT terminals
  148.     - freely programmable command line editing
  149.  
  150. Shell  runs  on  minimum stack, for recursive aliases and source files better
  151. increase stack to 8K or more.
  152.  
  153. If you use CShell for the first time, remember the following:
  154.     - CShell internal commands must be lowercase & can be abbreviated
  155.     - AmigaDOS command 'Execute' causes some trouble. You cannot redirect
  156.       it, you must not rename it, and you get no return code.
  157.       You can also use 'source' to start your scripts, but you'll have
  158.       to rewrite them a bit. Besides the '.key'-type commands, 'source' 
  159.       is downward compatible with 'Execute'.
  160.     - You can always get more information on a command if csh.doc is
  161.       in the current directoy or in csh: (you will be able to modify 
  162.       this) and you enter 'man <command>'
  163.  
  164.  
  165. III. RESTRICTIONS
  166. -----------------
  167.  
  168. The  following  applies only to Kickstart 2.0, and only to V36:  The INTERNAL
  169. commands cannot be started.  The same is true for the commands in C:  if they
  170. were  made  resident  using  the  AmigaDOS  'Resident' command (with cshell's
  171. 'resident' they work).  Thus, you should disable the INTERNAL residents using
  172. the -i0 startup option if you have a V36 Kickstart.
  173.  
  174. Under  1.3, you can't start AmigaDOS residents directly.  But you can use the
  175. -r  startup  option,  which  will  copy the AmigaDOS resident list to the arp
  176. resident  list once (and make those residents unremovable).  I'll try to find
  177. a better solution.
  178.  
  179. The  best  choice  under  both kickstarts is to make only csh itself AmigaDOS
  180. resident, all other commands, if any, ARP resident.  Under 1.3, you can start
  181. the  shell  (as any other commands) from the resident list only after you did
  182. 'resident CLI l:Shell-seg' and 'newcli'.
  183.  
  184. The  c:Execute command cannot be redirected, does not return error codes, and
  185. might cause other problems.  It will not work at all if it has been renamed.
  186.  
  187. The  VDK:  handler and Frank Seidel's BootRam-Handler have a bug with setting
  188. file  dates,  so  when  using  the  copy command you should try the -d and -p
  189. switches, otherwise your file date will be bad.  (This is not a shell bug)
  190.  
  191. If using with conman it you may consider starting shell with the -a switch to
  192. turn  off shell's command line editing and use conmans instead.  You'll lose,
  193. however, many shell features like TAB file name completion.
  194.  
  195. CB-handler  (a  tool that installs a scrollbar in the CLI window) is not 100%
  196. compatible  with  cshell.   The log will not always represent the real screen
  197. contents.
  198.  
  199.  
  200. IV. NOTES ON PIPES
  201. ------------------
  202.  
  203.     PIPES
  204.     PIPES  have  been implemented using temporary T:  files.  Thus, you
  205.     should be  careful  when  specifying  a 't:*' expansion as it might
  206.     include the temporary files. These files are deleted on completion
  207.     of the pipe segment.
  208.  
  209.     The file names used are completely unique, even with multiple shell
  210.     running simultaneously.
  211.  
  212.     My  favorite  new  feature is the fact that you can now redirect to
  213.     and  from,  and pipe internal commands.  'echo charlie >ram:x', for
  214.     instance.  Another favorite:
  215.  
  216.     echo "echo mem | csh" | csh
  217.  
  218.     No BCPL program should be output-append redirected (>>).
  219.  
  220.  
  221. V.  COMMAND PRE-PROCESSOR
  222. -------------------------
  223.  
  224.     PREPROCESSING
  225.     Preprocessing is done on the command line before it is passed on to
  226.     an internal or external routine:
  227.  
  228.     ^c    where c is a character is converted to that control character.
  229.         Thus, say '^l' for control-l.
  230.  
  231.     \233    insert character code 233 octal. Do not use values between
  232.         200o and 232o, as they have special meanings. \240 is the
  233.         word separator.
  234.  
  235.     $name    where name is a variable name.  Variable names can consist of
  236.         0-9, a-z, A-Z, and underscore (_).  The contents of the
  237.         specified variable is used.  If the variable doesn't exist,
  238.         the specifier is used.  That is, if the variable 'i' contains
  239.         'charlie', then '$i' -> 'charlie'.  If the variable 'i' doesn't
  240.         exist, then '$i'->'$i' .
  241.  
  242.     ;    delimits commands.   echo charlie ; echo ben.
  243.  
  244.     ' '    (a space). Spaces delimit arguments.
  245.  
  246.     "string" a quoted string. Trailing quotes are optional. For instance,
  247.         if you want to echo five spaces and an 'a':
  248.  
  249.         echo      a       -> a
  250.         echo "    a"      ->      a
  251.  
  252.     \c    overide the meaning of special characters.  '\^a' is a
  253.         circumflex and an a rather than control-a.  To get a backslash,
  254.         you must say '\\'.
  255.  
  256.         also used to overide alias searching for commands.
  257.  
  258.     >file    specify output redirection.  All output from the command is
  259.         placed in the specified file.
  260.  
  261.     >>file    specify append redirection (Does not work with BCPL programs).
  262.  
  263.     <file    specify input redirection. The command takes input from the
  264.         file rather than the keyboard (note: not all commands require
  265.         input; it makes no sense to say 'echo <charlie' since
  266.         the 'echo' command only outputs its arguments).
  267.  
  268.     |    PIPE specifier.  The output from the command on the left becomes
  269.         the input to the command on the right.  The current SHELL
  270.         implimentation uses temporary files to store the data.
  271.  
  272.     !!    execute the previously executed command.
  273.     !nn    (nn is a number).  Insert the history command numbered n (see
  274.         the HISTORY command)
  275.     !partial search backwards through the history list for a command which
  276.         looks the same as 'partial', and execute it.
  277.  
  278.     #    enter comment.  The rest of the line is discarded (note: \#
  279.         will, of course, overide the comment character's special
  280.         meaning)
  281.  
  282.     {e hi;e ho} executes two commands as one, so they can be redirected
  283.         as one, so they can be redirected together (see ALIAS
  284.         command). The traling curly brace is optional.
  285.  
  286.     $(foo)    insert the stdout of the command 'foo' at this position of
  287.         the command line. Every line of the output will count as one
  288.         argument. The closing parenthesis is optional.
  289.  
  290.     `foo`    insert the stdout of the command 'foo' at this position of
  291.         the command line. Every blank separated word will count as
  292.         one argument. The trailing backtick is optional.
  293.  
  294.     Please note the subtle differences between
  295.         alias count {echo one;echo two}
  296.         alias count "echo one;echo two
  297.     The first form will create an alias that contains a local alias. The
  298.     other will create a plain alias. Also, things within braces will not
  299.     be parsed more than once, therefore a backslash needs not be pre-
  300.     ceeded by a pair of backslashes. Thus the commands look the same as
  301.     if they were to be typed in at the prompt. To echo lots of '#', 
  302.     either use:
  303.         forever {echo \#
  304.         forever "echo \\\#
  305.     A block can spread over several line. Refer to the SOURCE command.
  306.  
  307.  
  308. VI. COMMAND LINE EDITING
  309. ------------------------
  310.  
  311.     o Command line can be up to 255 chars.
  312.     o Inserts  and  deletes  are handled correctly over multiple screen
  313.       lines.
  314.     o Shell  will  keep  track  of the line width should the window get
  315.       resized.
  316.  
  317.     EDITING
  318.  
  319.     -- MOVING --
  320.     Left Arrow      One character left
  321.     Right Arrow      One character right
  322.     Shift-Left Arrow  One word left
  323.     Shift-Right Arrow One word right
  324.     ESC-Left Arrow      Beginning of line (^A) (^Z)
  325.     ESC-Right Arrow      End of line       (^E)
  326.     -- DELETING --
  327.     Backspace      Previous character
  328.     Del          Character under cursor
  329.     ESC-Backspace      Previous word     (^W)
  330.     ESC-Del          Next word    
  331.     ESC-x-Backspace      To start of line  (^B)
  332.     ESC-x-Del      To end of line    (^K)
  333.     ESC-d          Entire line       (^X)
  334.     -- HISTORY --
  335.     Up Arrow      Recall previous commands
  336.     Down Arrow      Recall commands
  337.     Shift-Up Arow      Get history from partial (or number)
  338.     Shift-Down Arrow  Go below last command of history
  339.     ESC-Up Arrow      Get start of history
  340.     ESC-Down Arrow      Get end of history
  341.     ESC-!          Get history from partial (or number)
  342.     ^T          Insert tail (all but first word) of previous line
  343.     ^P          Duplicate previous word (useful for mv)
  344.     -- COMPLETION --
  345.     TAB          Inserts first matching file name
  346.     Shift-TAB      Inserts longest common substring
  347.     ESC-TAB          Inserts all matching file names
  348.     ESC-c          Does a quick cd on left word (TAB for cycling)
  349.     ESC-~          Inserts the last current directory
  350.     -- EXECUTING LINE --
  351.     Return          Executes line
  352.     ESC-Return      Executes this line of history & brings up next one
  353.     ^N          Next line. Don't exec this one but store history
  354.     ^\          EOF (directly exits)
  355.     -- MISCELLANEOUS --
  356.     ^L          Retype current line.
  357.     ^O          Echo a ^O
  358.     ^R          Repeat last command (don't play with this)
  359.     ^U          Undo/Redo last edit 
  360.     ESC-i          Toggle Insert/Overwrite
  361.     f1-f10          Execute command if variable exists.
  362.     F1-F10          More commands (Shifted f keys).
  363.     Help          Invokes help command
  364.  
  365. Whenever  the cursor is placed on or directly after an incomplete file name
  366. and   you  press  TAB,  CShell  inserts  for  the  first  filename  (sorted
  367. alphabetically)  that  matches  the name part already typed.  Any wildcards
  368. are allowed here, if none are given, '*' is appended.  Immediately pressing
  369. TAB  again  brings  up  the  next  file  name  that  matched the substring.
  370. Shift-TAB  will  only  insert  the  as  much as is common to all files that
  371. matched  you  abbreviation.   If  pressed  again,  behaves  just  like TAB.
  372. ESC-Tab  inserts  the  name  of the directory where you would have ended up
  373. with a quick cd to that substring.
  374.  
  375. Note  that  ^D  now  means  'quit  batchfile' like under AmigaDOS and is no
  376. longer used for quitting CShell. If you want it back, enter 'keymap 0 4=41'
  377.  
  378. The  CTRL  keys FGVY are unset, feel free to map them to any function (see
  379. chapter XV).  You can also remap all preset keys.
  380.  
  381. VII. FUNCTION KEYS
  382. ------------------
  383.  
  384.     FUNKEY
  385.     Function keys now insert text to the current position on the command
  386.     line. They maybe terminated with a ^M (return). f1 would be non shifted
  387.     where as F1 is shifted.
  388.     Most of functions key have a default definition, but it may be changed.
  389.  
  390.         $ set f1 dir df0:^M
  391.  
  392.     will add the text 'dir df0:<return>' to the current line.
  393.  
  394.         $ set f1 dir
  395.  
  396.     would only add 'dir' you could then enter ' df0:<return>'
  397.  
  398.  
  399. VIII. SHELL COMMANDS
  400. --------------------
  401.  
  402.     STARTUP OPTIONS
  403.     First to start shell from a CLI:
  404.  
  405.     shell [-abcfiknstv] [-c command;command]
  406.     shell [-abcfiknstv] [batchfile1 ... batchfileN]
  407.  
  408.      -a  AUX: mode. No command line editing and text highlighting
  409.      -b  starts shell in background, which means only task priority -1.
  410.      -c  allows execution of one command line and then exits out
  411.          of  shell.   This  is  useful for running an internal shell
  412.          commands in the background or from an external application:
  413.         Run csh -c "dir df0:; copy -r df0: df1: >nil:; echo Done"
  414.      -f  starts shell in foreground, which means only task priority 1.
  415.          you might reset this prioritiy to 0 at the end of your .login
  416.      -i0 disables INTERNAL residents. for V36 kickstarts.
  417.      -k  sets _nobreak before doing anything
  418.      -n  suppresses starting of s:.login
  419.      -r  copies the amiga resident list to the arp resident list. You
  420.          can't remove them anymore. No copying when under kick 2.0 or
  421.          if arp residents present.
  422.      -s  globally enables the star '*' as alias for #? in AmigaDOS 2.0
  423.      -t  terminal mode. You can use command line editing and text high-
  424.          lighting on a VT100 compatible terminal.
  425.      -v  sets _verbose to 'hs' before doing anything.
  426.  
  427.     Under 1.3, the best thing you can do is to make csh resident using
  428.     the AmigaDOS Resident command in the startup-sequence, then start
  429.     it with the option -r, so you can start another resident csh from
  430.     inside csh. NOTE: Residents copied using -r cannot be removed! I
  431.     advise you to use the internal resident command for all but csh
  432.     itself.
  433.  
  434.     COMMAND EXECUTION
  435.  
  436.     Internal shell commands are case sensitive and may be abreviated.
  437.  
  438.    The first argument is the command-name... here is (in order) how Shell
  439.    tries to execute it:
  440.  
  441.     1)  The alias list is searched for an alias with an exactly 
  442.         matching name.
  443.     2)  Internal commands list is scanned for a command even partially
  444.         matching name (so you can, for instance, say resi for resident;
  445.         however, you should specify enough of a command to be unique).
  446.     3)  Then, the list of functions is scanned for a command that
  447.         matches completely. If one is found, the result of the function
  448.         is echoed to stdout.
  449.     4)  Now the command is assumed to be external. Arguments with spaces
  450.         or empty strings will be surrounded by quotes.
  451.     5)  If the file is a directory, a 'cd <file>' will be performed to
  452.         it.
  453.     6)  AmigaDOS and ARP resident list are scanned for it (you can use
  454.         Shell's 'resident' command to add/remove a file in the ARP list).
  455.     7)  If the file is in the current directory and it's executable, it
  456.         is started.
  457.     8)  Then it is searched in the AmigaDOS path and c: (NOTE: Path
  458.         assigns to C: under Kickstart 2.0 don't work; use 'path')
  459.     9)  Now, the shell path ($_path) is searched. If it's found and 
  460.         executable, it's be started. If it has the 's' bit set, it will
  461.         be 'c:Execute'd.
  462.     10) If there exists a file with the suffix '.sh' and the same root
  463.         in the current directory or in the shell path, it is 'source'd.
  464.     11) Then the variable _rxpath is examined. If there exists a file
  465.         with the suffix '.rexx' and the same root in the current direc-
  466.         tory or in '$_rxpath', 'RX <file>' will be performed.
  467.     12) If all failed, an 'exec' action is sent to the file. See chapter
  468.         XIV for more info on classes and actions.
  469.  
  470.     To enforce that the external 'dir'-command is used, enter 'Dir'. Tt
  471.     is a good habit to uppercase the first letter of all external com-
  472.     mands, even if this is not necessary.
  473.  
  474.     AUTOMATIC SOURCING may be accomplished by naming shell scripts with
  475.     a  .sh  suffix.   Thus,  if you say 'stuff' and the file 'stuff.sh'
  476.     exists in your current or anywhere in Shell search path (NOTE: won't
  477.     be found in the AmigaDOS path), it will be SOURCED  with all arguments
  478.     you  have given placed  in  the  $_passed variable. This is equivalent
  479.     to typing 'source stuff.sh'
  480.  
  481.     WILD CARD EXPANSION
  482.     Most shell commands will accept multiple arguments that can
  483.     be as a result of wild card expansion.  Also when calling
  484.     an external command shell will first expand any wild cards
  485.     to separate arguments.  If you wish to have the external command
  486.     handle it's own wild carding you will need to insert quotes
  487.     around the special wild card characters or use an alias (see
  488.     explanation of 'alias')
  489.  
  490.     eg.
  491.         arc a new.arc *.txt    - shell will expand and pass to arc
  492.         arc a new.arc "*.txt"    - let arc expand the wild cards.
  493.         alias arc "*a Arc $a"    - now shell will never expand
  494.  
  495.     Wildcards allowed:
  496.  
  497.     ?    match any single character
  498.     *    match any string
  499.     .../*    recursive search down ALL sub directories from current level
  500.     ~    exclude pattern matching specifier
  501.     !    synonym for ~, supported for compatibility
  502.     &    prefixed to patterns, ask confirmation for each file
  503.     []    character class
  504.     ~    the previous current directory (if separated)
  505.     Note that a pattern must contain a '?' or a '*', otherwise the other
  506.     special characters are not recognized. Furthermore, you cannot spe-
  507.     cify a single '?' as a pattern in the first argument to a command,
  508.     as this will be passed on to the command in order to show its usage.
  509.  
  510.     Examples:
  511.  
  512.     df0:.../*    all files in all directories on df0:
  513.     df0:.../!*.info    full directory tree of df0: but exclude
  514.             any ugly .info files.
  515.     !*.o !*.c    will result in ALL files matching since what
  516.             doesn't match the !*.o will match the !*.c
  517.     df1:&*        all files in root of df1:, but ask 
  518.             confirmation for each
  519.     *.[co]        all files ending in .c or .o
  520.     ~*.[co]        all files NOT ending in .c nor in .o
  521.     ~        the previous current directory
  522.     ~/*.c        all .c files in the previous current directory
  523.     ~//        the parent of the previous current directory
  524.     .        the current directory
  525.     ./foo.c        the same as foo.c
  526.     ..        the parent of the current directory
  527.     ../foo.c    the file foo.c in the parent directory
  528.  
  529.     Note that some commands prevent wild card expansion. These are:
  530.       - dir, rpn, whereis, window
  531.     Those commands will expand the wild cards themselves. This is why
  532.       dir @without( *.? , *.o )
  533.     will not work. Instead use:
  534.       set arg @without( *.? , *.o );dir $arg
  535.  
  536.     There is one exception to the rules given above: A single '?' as
  537.     the first argument will *not* expand in order to allow you to get
  538.     the usage of CLI and csh commands easily.
  539.  
  540.     The   following   symbols  are  not  yet  supported  by  wild  card
  541.     expansions, but are accepted in search -w:
  542.  
  543.     ( | )    OR matching
  544.     #    0 or more times the pattern following
  545.  
  546.     Examples:
  547.  
  548.     "k#a"        matches ka, kaa, kaaa, etc.
  549.     "hel(lo|p)"    matches hello or help.
  550.  
  551.  
  552. LIST OF COMMANDS:
  553. -----------------
  554.  
  555.     ABORTLINE
  556.     Usage    : abortline
  557.     Example    : echo a;abort;echo b
  558.     Results    : a
  559.  
  560.     Causes the rest of the line to be aborted. Intended for use in
  561.     conjunction with exception handling.
  562.  
  563.     ACTION
  564.     Usage    : action [-a] actionname file [arguments]
  565.  
  566.     Sends an action to a file. See chapter XIV CLASSES
  567.     Options:
  568.      -a (abort) returns 0 if failed and 1 if successful. Otherwise,
  569.                 normal error codes (10 or 11) are returned
  570.  
  571.     ADDBUFFERS
  572.     Usage    : addbuffers drive buffers [drive buffers ...]
  573.     Example    : addbuffers df0: 24
  574.  
  575.     Just like AmigaDOS addbuffer command, causes new buffers to be
  576.     allocated for disk I/O. Each buffer costs 512 bytes of memory,
  577.     CHIP memory if a disk drive.
  578.  
  579.     ALIAS
  580.     Usage    : alias [name [command string] ]
  581.     Example    : alias vt "echo Starting VT100;run sys:tools/vt100"
  582.  
  583.     Sets a name to be a string. You can alias a single name to a set
  584.     of commands if you enclose them in quotes as above. By simply
  585.     typing vt, the command line above would be executed.
  586.     Aliases may call each other, but direct recursion is prohibited,
  587.     so the following works: alias ls "ls -s"
  588.     To prevent alias replacement, enter: \ls
  589.  
  590.     By typing "alias name", you will get the alias for that name, while
  591.     with "alias" you get a list of all alias.
  592.  
  593.     ARGUMENT PASSING TO AN ALIAS:
  594.  
  595.     Usage    : alias name "%var[%var...] [ command_string ]"
  596.           alias name "*var[%var...] [ command_string ]"
  597.     Example    : alias xx "%q%w echo hi $q, you look $w
  598.           xx Steve great today
  599.     Results    : hi Steve, you look great today
  600.  
  601.     The second form of the alias command allows passing of arguments
  602.     to any position within the command string via use of a variable
  603.     name. To pass arguments to the end of a command string this method
  604.     is actually not necessary. These variables are local, so they don't
  605.     destroy another variable with the same name.
  606.     If you specify multiple arguments, every argument will be assigned
  607.     one word, and the last argument will be assigned the rest of the
  608.     command line.
  609.  
  610.     Using a '*' instead of the first '%' prevents wild card expansion:
  611.         alias zoo "*a zoo $a
  612.     To expand the wild cards after you got them, use
  613.         exec set a $a
  614.  
  615.     IMPLICIT ALIASES:
  616.  
  617.     Usage    : {command;command}
  618.           {%var command;command} arg arg
  619.     Example    : {%tmp echo $tmp $tmp} hello
  620.     Results    : hello hello
  621.  
  622.     Curly braces define a temporary aliases. They can be redirected as
  623.     a whole, can have arguments and local variables. They count as
  624.     one argument, even if there are blanks inside (as with quotes), and
  625.     they may be nested. Complex alias definitions can use the braces
  626.     instead of quotes, although this will add some calling overhead.
  627.     The closing curly brace is optional if at the end of line.
  628.     Example:
  629.  
  630.     alias assert {e "Are you sure? ";input -s sure
  631.  
  632.     ASCII
  633.     Usage    : ascii
  634.           ascii string
  635.  
  636.     If called without arguments, ascii outputs a complete ascii table.
  637.     Given a string, shows each character in ascii. Options:
  638.       -h shows numbers in hexadecimal
  639.       -o shows numbers in octal
  640.  
  641.     ASET
  642.     Usage    : aset name value
  643.     Example    : aset INCLUDE include:
  644.  
  645.     Set a variable in a way that is compatible with ARP/old Aztec set
  646.     command; this is completely different from ENV: Shell variable.
  647.  
  648.     ASSIGN
  649.     Usage    : assign
  650.           assign logical
  651.           assign [-lnp] logical1 physical1 [logical2 physical2 ... ]
  652.  
  653.     The first form shows all assigns.
  654.     The second form kills one assign.
  655.     The third form assigns logical1 to physical1 and so on. Options:
  656.      -l creates a late-binding assign under kick 2.0, normal otherwise
  657.      -n creates a non-binding assign under kick 2.0, normal otherwise
  658.      -p creates a path-assign under kick 2.0, cancelled otherwise
  659.     For definition of late/nonbinding, refer to your AmigaDOS manual.
  660.  
  661.     BASENAME
  662.     Usage    : basename var path
  663.     Example    : basename x df0:c/Dir    # sets x to "Dir"
  664.  
  665.     Sets var specified to basename of path.
  666.  
  667.     CAT
  668.     Usage    : cat [-n][file file....]
  669.     Example    : cat foo.txt
  670.  
  671.     Type the specified files onto the screen.  If no file is specified,
  672.     STDIN in used (note: ^\ is EOF).  CAT is meant to output text files
  673.     only. Specifying -n option you will get numbered lines.
  674.  
  675.     CD
  676.     Usage    : cd [path]
  677.           cd -g device1 [device2 [device3 ...]]
  678.  
  679.     Change your current working directory.  You may specify '..' to go
  680.     back one directory (this is a CD specific feature, and does not
  681.     work with normal path specifications).
  682.  
  683.     In most cases, you'll no more have to use the CD command. Just type
  684.     the desired directory at the prompt (very handy in conjunction with
  685.     file name completion). Typing a ~ alone on a command line cd's
  686.     to prevous current directory.
  687.  
  688.     There are two situations left when you still need it:
  689.  
  690.     Entering 'cd *tem' will cd to the first name matched.
  691.  
  692.     The second form generates a list (an ascii file) of all direc-
  693.     tories on the given devices. It will be stored in the file given
  694.     in $_qcd (default: 'csh:csh-qcd'). Note that this ascii file  will
  695.     not be merged but overwritten. Once you have generated this file,
  696.     you can cd to any directory on your harddisk(s) even if it's not
  697.     in the current directory.
  698.     If you have two directories of the same name and you use one of
  699.     them more, move the more important one to the beginning of the
  700.     qcd file. You might also sort the file.
  701.     It is legal to type just an abbreviation of the directory name
  702.     you want to cd to. No asterisk '*' necessary. If you end up in
  703.     the wrong directory, cd to the same directory again (best done
  704.     by Cursor-Up + RETURN). You will cycle through all directories
  705.     that matched the given abbreviation. The other possibility is to
  706.     specify the full name of the parent directory: cd devs/keym
  707.     You may also add devices and assigns, so if 'PageStream:' is one
  708.     line in the qcd-file, a cd to 'page' is successful.
  709.  
  710.     CD without any arguments displays the path of the directory you
  711.     are currently in.
  712.  
  713.     CLASS
  714.     Usage    : [-n] name {type=param} [ "actions" {action=command} ]
  715.     Example : class zoo offs=20,dca7c4fd ext=.zoo actions view="zoo l"
  716.  
  717.     Defines a new class of files and the actions to be taken on them
  718.     in various cases, or shows old definitions if given no arguments.
  719.     See section XIV: OBJECTS
  720.     Options:
  721.       -n (new)  forgets old definitions
  722.  
  723.  
  724.     CLOSE
  725.     Usage    : close [filenumber]
  726.  
  727.     Close the specified file opened by open. Without filenumber, closes
  728.     all open files. See open and flist for more info.
  729.  
  730.     CLS
  731.     Usage    : cls
  732.  
  733.     This is an alias. It only clears the screen, but also works on a
  734.     terminal (e ^L doesn't).
  735.  
  736.     COPY (CP)
  737.     Usage    : copy [-udfpm]  file file
  738.     or    : copy [-udfpm]  file1 file2...fileN dir
  739.     or    : copy [-rudfp] dir1...dirN file1...fileN dir
  740.  
  741.     Options    :
  742.       -r recursive, copy all subdirectories as well.
  743.       -u update, if newer version exists on dest, don't copy
  744.       -f freshen, if file doesn't exist on dest or newer, don't copy
  745.       -d don't set destination file date to that of source.
  746.       -p don't set destination protection bits to those of source.
  747.       -m erases the original. does not work with -r
  748.  
  749.     Example    : copy -r df0: df1:
  750.  
  751.     Copy files or directories. When copying directories, the -r option
  752.     must be specified to copy subdirectories as well.  Otherwise, only
  753.     top level files in the source directory are copied.
  754.  
  755.     All files will be displayed as they are copied and directory's
  756.     displayed as they are created. This output can be suppessed by
  757.     redirecting to nil: eg. copy -r >nil: df0: df1:
  758.  
  759.     Copy will abort after current file on Control-C.
  760.  
  761.     Copy by default sets the date of the destination file to that of
  762.     the source file. To overide this feature use the -d switch.
  763.  
  764.     Similarly, it sets protection bits (flags) to those of source and
  765.     any file comment will be copied. To avoid this use -p. The archive
  766.     bit is always cleared.
  767.  
  768.     Another useful option is the -u (update) mode were copy will not
  769.     copy any files which exists already in the destination directory
  770.     if the destination file is newer or equal to the source file.
  771.     This is useful when developing code say in ram: eg. 'copy *.c ram:'
  772.     when done you can copy -u ram: df1: and only those modules you have
  773.     modified will be copied back.
  774.  
  775.     Copy command will now create the destination directory if it does
  776.     not exist when specified as 'copy [-r] dir dir'. If you specify
  777.     copy file file file dir, then 'dir' must already exist.
  778.  
  779.     CP
  780.     Equivalent to copy.
  781.  
  782.     DATE
  783.     Usage    : date [-sr] [new date and/or time]
  784.     Example    : date Wednesday  # this refers to NEXT wed, of course
  785.  
  786.     Used to read or set system date and/or time. All standard options
  787.     may be used (yesterday, tomorrow, monday, etc.).
  788.     Leading zero's are not necessary.
  789.     Without parameters shows Dddddd DD-MMM-YY HH:MM:SS.
  790.     Options:
  791.       -s stores the current time
  792.       -r shows time relative to last stored in secs and hunderths
  793.  
  794.     DEC
  795.     Usage    : dec varname [value]
  796.     Example    : dec abc
  797.  
  798.     Decrement the numerical equivalent of the variable with specified
  799.     value (default: 1) and place the ASCII-string result back into
  800.     that variable.
  801.  
  802.     DELETE (RM)
  803.     Usage    : delete [-p][-r] file file file...
  804.     Example    : delete foo.txt test.c
  805.  
  806.     Remove (delete) the specified files.  Remove always returns
  807.     errorcode 0.  You can remove empty directories.  The '-r' option
  808.     will remove non-empty directories by recursively removing all sub
  809.     directories.
  810.     You can remove delete-protected files specifying -p option.
  811.     If you specify any wildcard deletes the files will be listed as
  812.     they are deleted. This can be suppressed by redirecting to nil:
  813.  
  814.     DIR     (LS)
  815.     Usage    : dir [-abcdfhiklnoqstuv] [-z lformat] [path path ... ]
  816.     Example    : dir -ts downloads:
  817.           dir -lz "%7s %-.16n %m" *.c
  818.     Options:
  819.      -d list directories only
  820.      -f list files only
  821.      -h list only files which not start with a dot, end with '.info' or
  822.         have the h-flag set.
  823.      -s short multi(4) column display.
  824.      -c don't change colors for directories
  825.      -q quiet display. does not show length in blocks
  826.      -o display file nOtes
  827.      -n display names only
  828.      -p display full path names and suppress directory titles
  829.      -a shows the age of all files in the format  days hours:minutes
  830.      -i identifies every file, shows the type instead of the date.
  831.         See chapter XIV CLASSES
  832.      -v (viewdir) recursively sums up lengths of the files in a dir
  833.      -l sorts the files by their length, longest first.
  834.      -t sorts the files by their time, most recent first.
  835.      -k sorts the files by their class (klass)
  836.      -b sorts the files backwards.
  837.      -g prints directories at the beGinning
  838.      -e prints directories at the End
  839.      -u must be given exactly two directories. Shows files only in
  840.         the first directory, files in both and files in the second.
  841.      -z custom format
  842.  
  843.     Displays a directory of specified files. Default output shows
  844.     date, protection, block size, byte size and total space used.
  845.     Protections flags include new 1.2/1.3 flags (see under protect),
  846.     plus a 'c' flag which indicates that this file has a comment.
  847.     Files are alphabetically sorted, without case sensitivity, and
  848.     directories are in red pen (unless you use -c). Dir takes in
  849.     account the width of your window.
  850.  
  851.     The lformat string is used to create your own directory format.
  852.     It will override all else and may contain the following codes:
  853.      %a age               %l LF if comment      %s size
  854.      %b size in blocks    %m multi column       %t time
  855.      %c flag c (comment)  %n name               %u size in K
  856.      %d date              %o filenote (comment) %v dir size in eng.
  857.      %f flags hsparwed    %p name w/ path       %w dir size in K
  858.      %i flag d (dIr)      %q name w/ slash      %x translated date
  859.      %k class             %r size in eng
  860.     Between the '%' and the identifying letter, there may be an optional
  861.     field width. If the number is preceded by a '-', the field contents
  862.     will be left adjusted. If by a dot, the contents will be cut down
  863.     to match the field width if they are longer.
  864.     If the format string contains a %m, cshell will try to print more
  865.     than one entry on one line. The column width is the field width of
  866.     the %m entry. If omitted, it's assumed to be the one of the first 
  867.     file. If a file is longer, it will use two columns.
  868.  
  869.     DISKCHANGE
  870.     Usage    : diskchange drive
  871.  
  872.     Like AmigaDOS diskchange.
  873.  
  874.     ECHO
  875.     Usage    : echo [-en] string
  876.     Example    : echo hi there
  877.     Results    : hi there
  878.  
  879.     Echo the string given. If -n switch given no newline is
  880.     appended. If -e is on, echo to stderr.
  881.  
  882.     ELSE
  883.     Usage    : else ; command
  884.     Usage    : if -f foo.c ; else ; echo "Not there" ; endif
  885.  
  886.     Else clause, must follow an IF statement.
  887.  
  888.     ENDIF
  889.     Usage    : endif
  890.  
  891.     The end of an if statement.
  892.  
  893.     Note: if you return from a script file with unterminated IF's
  894.     and the last IF was false, prompt will be changed to an
  895.     underscore ('_') and no commands will be executed until
  896.     'endif' is typed.
  897.  
  898.     EXEC
  899.     Usage    : exec command [args]
  900.     Example    : set util SYS:sytem/utilities
  901.           exec $util/make    # would not work without exec
  902.  
  903.     Execute the command specified; exec command is equivalent to
  904.     command, only you can use variables to specify command name.
  905.     Note that the command line is parsed TWICE, so the commands
  906.        set a dir ram:; exec $a              # right
  907.     works fine, but
  908.        set a mkdir; exec $a "My directory"  # wrong!
  909.     would create two directories.
  910.  
  911.     FAULT
  912.     Usage    : fault error1 .. errorN
  913.     Example    : fault 205 212
  914.  
  915.     Like AmigaDOS fault, prints specified error messages.
  916.  
  917.     FILENOTE
  918.     Usage    : filenote file1 .. fileN  note
  919.           filenote -s file1...fileN
  920.  
  921.     The first form sets AmigaDOS comment of the specified file.
  922.     The second form display the file notes of the given files.
  923.  
  924.     FLIST
  925.     Usage    : flist
  926.  
  927.     Lists the filenumbers of files opened by open.
  928.     See open and close for more info.
  929.  
  930.     FLTLOWER
  931.     Usage    : fltlower
  932.     Example    : dir | fltlower
  933.     Or    : fltlower <readme
  934.  
  935.     This is a filter command, i.e. it reads from stdin and writes to
  936.     stdout. The more natural way to use it is a pipe, or it can be
  937.     redirected.
  938.     Its purpose is to convert all alphabetic to lower case.
  939.  
  940.     FLTUPPER
  941.     The same of fltlower, only this converts to upper case.
  942.  
  943.     FOREACH
  944.     Usage    : foreach [-v] varname ( strings ) command
  945.     Example    : foreach i ( a b c d ) "echo -n $i;echo \" ha\""
  946.     Result    : a ha
  947.           b ha
  948.           c ha
  949.           d ha
  950.  
  951.     'strings' is broken up into arguments.  Each argument is placed in
  952.     the variable 'varname' in turn and 'command' executed.  To execute
  953.     multiple commands, place them in quotes.
  954.  
  955.     Foreach is especially useful when interpreting passed arguments in
  956.     an alias.
  957.  
  958.     eg.
  959.         foreach i ( *.pic ) viewilbm $i
  960.     assuming a.pic and b.pic in current directory the following commands
  961.     will occur:
  962.         viewilbm a.pic
  963.         viewilbm b.pic
  964.  
  965.     Flag -v causes arguments to be displayed every time command is
  966.     executed.
  967.  
  968.     FOREVER
  969.     Usage    : forever command
  970.     or    : forever "command;command;command..."
  971.  
  972.     The specified commands are executed over and over again forever.
  973.  
  974.     -Execution stops if you hit ^C
  975.     -If the commands return with an error code.
  976.  
  977.     FORLINE
  978.     Usage    : forline var filename command
  979.     or    : forline var filename "command;command..."
  980.     Example    : forline i RAM:temp "echo line $_linenum=$i"
  981.  
  982.     For each ASCII line of file specified commands are executed and
  983.     var points to line content. You can check system variable _linenum
  984.     to find the number of the line currently read.
  985.     If STDIN (case sensitive) is specified as input file, the lines are
  986.     read from standard input.
  987.  
  988.     FORNUM
  989.     Usage    : fornum [-v] var n1 n2 command
  990.     or    : fornum [-v] -s var n1 n2 step command
  991.     Example    : fornum -v x 1 10 echo $1
  992.     or    : fornum -s x 10 1 -1 echo $i # counts backwards
  993.  
  994.     Executes  command(s)  for  all numerical values of x between n1 and
  995.     n2.   If  more  than  one  command  is  specified,  or  command  is
  996.     redirected, include command(s) in quotes.
  997.     Switch -v (verbose) causes printing of progressive numbers.
  998.     Switch  -s  allows  you to specify a step; if this is negative, the
  999.     count will be backwards.
  1000.  
  1001.     GETENV
  1002.     Usage    : getenv [shellvar] envvar
  1003.  
  1004.     Gets the value of an ARP or ENV: variable (ARP list searched first)
  1005.     and stores it in the shell variable 'shellvar'. If shellvar is
  1006.     omitted, the value of the ENV: variable is printed to stdout.
  1007.  
  1008.     GOTO
  1009.     Usage    : goto label
  1010.     Example    :
  1011.           label start
  1012.             echo "At start"
  1013.             dir ram:
  1014.             goto start
  1015.  
  1016.     Goto  the specified label name.  You can only use this command from
  1017.     a  source  file.   Labels  may  be  forward or reverse from current
  1018.     position. It is legal to jump out of if's.
  1019.  
  1020.     HEAD
  1021.     Usage    : head filename [num]
  1022.     Example    : head readme 20
  1023.  
  1024.     Display  first "num" lines of "filename".  If num is not specified,
  1025.     10 is assumed.
  1026.  
  1027.     HELP
  1028.     Usage    : help
  1029.     Example    : help
  1030.  
  1031.     Simply  displays  all  the  available  commands.   The commands are
  1032.     displayed in search-order.  That is, if you give a partial name the
  1033.     first  command  that  matches  that  name  in  this list is the one
  1034.     executed.   Generally,  you  should  specify enough of a command so
  1035.     that it is completely unique.
  1036.  
  1037.     HISTORY
  1038.     Usage    : history [partial_string]
  1039.     Example    : history
  1040.  
  1041.     Displays  the  enumerated  history  list.   The size of the list is
  1042.     controlled  by  the  _history  variable.   If you specify a partial
  1043.     string, only those entries matching that string are displayed.
  1044.  
  1045.     HOWMANY
  1046.     Usage    : howmany
  1047.  
  1048.     This  command  tells you how many instances of Shell are running in
  1049.     your system.
  1050.  
  1051.     HTYPE
  1052.     Usage    : htype file1 .. filen
  1053.  
  1054.     Displays the specified files in hex and ASCII, just like the system
  1055.     command Type file opt h.  Especially suitable for binary files.
  1056.  
  1057.     IF
  1058.     Usage    : if [-n] argument conditional argument ;
  1059.     or    : if [-n] argument
  1060.     or    : if [-n] -f file
  1061.     or    : if [-n] -d file/dir
  1062.     or    : if [-n] -m
  1063.     or    : if [-n] -t file file1 .. fileN
  1064.     or    : if [-n] -r rpnexpression
  1065.     or    : if [-n] -v varname
  1066.     or    : if [-n] -o char arg ... arg
  1067.  
  1068.     If a single argument is something to another argument.  Conditional
  1069.     clauses allowed:
  1070.  
  1071.     <, >, =, and combinations (wire or).  Thus <> is not-equal, >=
  1072.     larger or equal, etc...
  1073.  
  1074.     If arguments are not numeric, they are compared as strings.
  1075.  
  1076.     Usually the argument is either a constant or a variable ($varname).
  1077.  
  1078.     The second form if IF is conditional on the existance of the argument.
  1079.     If the argument is a "" string, then FALSE, else TRUE.
  1080.  
  1081.     The third form of IF used by -f switch checks for existance of
  1082.     the specified file.
  1083.  
  1084.     Switch -d tests the type of the object specified: if it is a
  1085.     directory, then TRUE; if it is a file (or it doesn't exist)
  1086.     then FALSE.
  1087.  
  1088.     Switch -m is used to test if FAST memory is present.
  1089.     Example (to be included in a login.sh file):
  1090.     if -m; resident -d lc1 lc2 blink; endif
  1091.  
  1092.     Using -t form compares the date and time of the first file with
  1093.     all the others; if the first is younger than ALL the others, then
  1094.     FALSE, else TRUE. If a file doesn't exists, it is considered as
  1095.     being older.
  1096.     This feature is especially useful for building makefiles without
  1097.     using any MAKE utility.
  1098.     Example:
  1099.     if -t test.o test.asm test.i ; asm -o test.o test.asm ; endif
  1100.  
  1101.     Option -r evaluates a given RPN expression (see under RPN for more
  1102.     info): if value on top of stack is 0, then FALSE, else TRUE.
  1103.  
  1104.     Option -o tests for option 'char' in the rest of the arguments.
  1105.     Example: if -o r -rp ram:comm1.c     will yield TRUE.
  1106.  
  1107.     Switch -n (NOT) reverses the result.
  1108.  
  1109.     To test if a given variable is defined, use if -v varname.
  1110.  
  1111.     When using 'IF' command interactively if you are entering commands
  1112.     following an 'IF' that was false, the prompt will be set to a
  1113.     underscore '_ ' to indicate all commands will be ignored until
  1114.     an 'ELSE' or 'ENDIF' command is seen.
  1115.  
  1116.     INC
  1117.     Usage    : inc varname [value]
  1118.     Example    : inc abc 5
  1119.  
  1120.     Increment the numerical equivalent of the variable with specified
  1121.     value (default: 1) and place the ascii-string result back into
  1122.     that variable.
  1123.  
  1124.     INFO
  1125.     Usage    : info [path1 path2 ... pathN]
  1126.  
  1127.     If called without arguments, info gives you the drive information
  1128.     on all devices. If one or more paths are specified, only infor-
  1129.     mation on those drives will be displayed.
  1130.  
  1131.     INPUT
  1132.     Usage    : input [-s] var var ... var
  1133.     Example    : input abc
  1134.  
  1135.     Input from STDIN (or a redirection, or a pipe) to a variable.  The
  1136.     next input line is broken up in words (unless quoted) and placed in
  1137.     the variable. If -s is turned on, the whole line is read in as one
  1138.     word, including spaces. -r puts the console to single character mode
  1139.     before reding.
  1140.  
  1141.     JOIN
  1142.     Usage    : join [-r] file1..fileN destfile
  1143.     Example    : join part1 part2 part3 total
  1144.  
  1145.     Joins the specified files to get destfile. If destfile already
  1146.     exists, an error message is generated and operation is aborted,
  1147.     unless you specify -r (replace) option.
  1148.  
  1149.     KEYMAP
  1150.     Usage    : keymap number {key=function}
  1151.     Example    : keymap 0 1030=4 1032=12
  1152.  
  1153.     Defines one keymap for the cshell command line editing. See chapter
  1154.     XV.
  1155.  
  1156.     LABEL
  1157.     Usage    : label name
  1158.  
  1159.     Create a program label right here. Used in source files, can then
  1160.     GOTO a label.
  1161.  
  1162.     LINECNT
  1163.     Another filter. Counts the number of lines of its stdin and writes
  1164.     it to stdout.
  1165.  
  1166.     LOCAL
  1167.     Usage: local [var...var]
  1168.  
  1169.     Creates one or more local variables. Those variables disappear at
  1170.     at the end of their alias or source file, and cannot be accessed
  1171.     from inside other aliases or source files.
  1172.     With no arguments, shows all local variables and their values.
  1173.  
  1174.     LS
  1175.     Equivalent to dir.
  1176.  
  1177.     MD
  1178.     Equivalent to mkdir.
  1179.  
  1180.     MAN
  1181.     Usage    : man command(s)
  1182.     Example    : man mkdir
  1183.  
  1184.     Get  info about a Shell command, or others keywords.  These include
  1185.     all  special  _variables, plus various keywords:  WILDCARDS, PIPES,
  1186.     EDITING, STARTUP and more.
  1187.     See special alias manlist to get a list of ALL keywords supported
  1188.     by man.
  1189.     You  must set _man to the paths of your .doc files:
  1190.        set _man dh1:docs/aliases.doc dh1:docs/csh.doc
  1191.  
  1192.     To create your own .doc files, precede all your keywords by four
  1193.     blanks. 'man' will then display lines until the first character
  1194.     of a line is alphanumeric or has four leading blanks.
  1195.  
  1196.     MEM
  1197.     Usage    : mem [-cfqu]
  1198.  
  1199.     Options:
  1200.       -c shows the free chip mem only
  1201.       -f shows the free fast mem only
  1202.       -q outputs just a number without titles
  1203.       -s stores current free memory
  1204.       -r shows memory used relative to last stored 
  1205.  
  1206.     MENU
  1207.     Usage    : menu [-n] [ title item...item ]
  1208.     Example    : menu Shell   JrComm,,j   Rename,"rename ",r  quit
  1209.  
  1210.     Appends one pull down in the current console window. Up to six
  1211.     menus with 16 items every can be installed.
  1212.  
  1213.     If the item is just a string, that string will be in the menu item.
  1214.     When you select it, it will be put into the prompt and executed.
  1215.  
  1216.     If there is a comma and after that comma a second string, this
  1217.     will be the command will be inserted at the prompt. This time you
  1218.     have to add the ^M yourself if you want the command to be executed.
  1219.  
  1220.     If there is a second comma, the letter after that comma will be
  1221.     the keyboard shortcut for that menu item. (This will be case 
  1222.     sensitive some day, use lowercase).
  1223.  
  1224.     If for any reason your current menu is corrupt, just enter an
  1225.     empty 'menu' command.
  1226.  
  1227.     To clear all existing menus use option -n.
  1228.  
  1229.     MKDIR (MD)
  1230.     Usage    : mkdir name name name...
  1231.     Example    : mkdir df0:stuff
  1232.  
  1233.     Create the specified directories.
  1234.  
  1235.     MV
  1236.     Equivalent to rename.
  1237.  
  1238.     OPEN
  1239.     Usage    : open filename filemode filenumber
  1240.     Example    : open RAM:data w 1
  1241.  
  1242.     This  allows you to open a file, redirect to it as many commands as
  1243.     you like, then close it.
  1244.     Filename is any valid AmigaDOS filename, filemode is either "r" for
  1245.     read or "w" for write, filenumber is a number between 1 and 10.
  1246.     To  redirect  a  program to or from an open file, use as your redir
  1247.     filename a dot followed by the filenumber.
  1248.     Here is a complete example:
  1249.  
  1250.         open RAM:data w 1
  1251.         echo -n 2+2= >.1
  1252.         rpn 2 2 + . CR >.1
  1253.         close 1
  1254.         type RAM:data    # will display 2+2=4
  1255.  
  1256.     See also close, flist.
  1257.  
  1258.     PATH
  1259.     Usage    : path [-r] [dir...dir]
  1260.  
  1261.     Without arguments, lists AmigaDOS path. Otherwise adds given directories
  1262.     to the path, preventing duplicate entries.
  1263.     Options:
  1264.      -r Resets the path
  1265.  
  1266.     PRI
  1267.     Usage    : pri clinumber pri
  1268.     Example    : pri 3 5    # set priority of cli #3 to 5
  1269.  
  1270.     Change the priority of the specified task (use PS command to
  1271.     determine clinumber). If you specify 0 as clinumber you can
  1272.     change priority of "this" task (the one executing shell).
  1273.  
  1274.     PROTECT
  1275.     Usage    : protect file1 ... filen [+|-|=][flags]
  1276.     Example    : protect myfile +rwe
  1277.  
  1278.     Set AMIGADOS file protection flags for the file specified. Valid
  1279.     flags are h, s, p, a, r, w, e, d. Modes:
  1280.       +  Set specified bits, leave all others
  1281.       -  Clear specified bits, leave all others
  1282.       =  Set specified bits, clear all others
  1283.     Specifying no mode is equal to '='. Archive bit cleared by default.
  1284.  
  1285.     PS
  1286.     Usage    : ps [commandname...commandname]
  1287.  
  1288.     Gives status of CLI processes.  eg:
  1289.  
  1290.     Proc Command Name    CLI Type    Pri.  Address  Directory
  1291.     * 1  csh            Initial CLI   0      97b0  Stuff:shell
  1292.       2  clock            Background  -10    2101a8  Workdisk:
  1293.       3  emacs            Background    0    212f58  Stuff:shell
  1294.       4  VT100            Background    0    227328  Workdisk:
  1295.  
  1296.     Address is the address of the task, directory is the process
  1297.     currently CD'd directory. My default, only the BaseNames of
  1298.     the commands are shown. Your own CLI will be marked by an
  1299.     asterisk in the first column.
  1300.     Options:
  1301.      -l shows full pathnames of commands
  1302.      -e excludes the given command names from the list
  1303.  
  1304.     PWD
  1305.     Usage    : pwd
  1306.  
  1307.     Rebuild _cwd by backtracing from your current directory.
  1308.  
  1309.     QSORT
  1310.     Usage   : qsort [-r] <in >out
  1311.  
  1312.     Quick sorts from stdin to stdout. -r causes reverse sorting.
  1313.  
  1314.     QUIT
  1315.     Usage    : quit
  1316.  
  1317.     Quit out of Shell back to CLI.
  1318.  
  1319.     RBACK
  1320.     Usage    : rback command
  1321.  
  1322.     Start a new process executing the specified command, but can't do
  1323.     input/output. Equivalent to 'run command >NIL: <NIL:'. Instead of
  1324.     using rback, you can add a '&' at the end of the command line. The
  1325.     variable $_newproc will hold the cli number of the newly created
  1326.     process.
  1327.     Note: rback cannot start builtin commands. You have to start a
  1328.           subshell: rback csh -c "copy ram:temp prt:;rm ram:temp
  1329.  
  1330.     READFILE
  1331.     Usage    : readfile varname [filename]
  1332.  
  1333.     Completely reads a (short!) ascii file and assigns it to a variable.
  1334.     Each line becomes one word in the resulting string. Embedded blanks
  1335.     are no problem. If file name is omitted, stdin is used.
  1336.  
  1337.     RENAME (MV)
  1338.     Usage    : rename from to
  1339.     or    : rename from from from ... from todir
  1340.  
  1341.     Allows you to rename a file or move it around within a disk.
  1342.     Allows you to move 1 or more files into a single directory.
  1343.     The archive bit of the file(s) will be cleared.
  1344.  
  1345.     RESIDENT
  1346.     Usage    : resident [-r][-d] [files]
  1347.     Example    : resident lc1 lc2 blink    # load these as resident
  1348.           resident -d lc1 lc2 blink    # defer load when needed
  1349.           resident -r lc1 lc2 blink    # remove these
  1350.           resident            # list resident programs
  1351.  
  1352.     This is ARP resident. Commands are searched by Shell in resident
  1353.     list BEFORE of searching on any external device.
  1354.     Only PURE programs can run as resident, see ARP docs for more info.
  1355.     Option -d is very useful: you can say, in your startup file,
  1356.     resident -d file...file; programs will not be loaded immediately,
  1357.     but only when you will try to load them. This way, you will not
  1358.     waste memory and startup time if you don't use the programs.
  1359.     Old option -a has no more effect.
  1360.  
  1361.     RETURN
  1362.     Usage    : return [n]
  1363.     Example    : return 10
  1364.  
  1365.     Exit from a script file, or quit from shell with optional
  1366.     exit code.
  1367.  
  1368.     RM
  1369.     Equivalent to delete.
  1370.  
  1371.     RPN
  1372.     Usage    : rpn expression
  1373.     Example    : rpn 3 7 *    # Prints the value 21
  1374.  
  1375.     Evaluate an RPN expression, using 32-bit values. In older versions
  1376.     of Shell RPN contained string functions too, but now that strings
  1377.     are handled by specifical commands, these are no more needed.
  1378.     At end of evaluation, RPN prints values on stack, so you can
  1379.     say for instance "rpn $x 2 * | input x" to double the value of
  1380.     variable x.
  1381.     Functions implemented are:
  1382.  
  1383.         + - * /    Obvious meaning; / means integer division, of course
  1384.         %        Module operator e.g. "rpn 7 3 %" answers 1
  1385.         & | ~    Bitwise and, or, not operators
  1386.         > < ==    Tests for greater-than, lower-than, equal. To get
  1387.             a test for >= (or <=), you can use < ! (or > !)
  1388.         !        Logical not operator
  1389.         DUP        Duplicate value on top of stack
  1390.         DROP    Drop value on top of stack
  1391.         SWAP    Swap two values on top of stack
  1392.  
  1393.     To avoid confusion with redirections, > and < operators must be
  1394.     enclosed in quotes e.g.
  1395.  
  1396.         3 2 ">"        # Prints 1
  1397.  
  1398.     RUN
  1399.     Usage    : run prgm args
  1400.     Example    : run emacs test.c
  1401.  
  1402.     Start a new process executing the specified command.
  1403.     In current implementation run command can't be redirected.
  1404.     This command is not fully reliable: use at your own risk.
  1405.     $_newproc will hold the cli number of the new process.
  1406.     See also rback.
  1407.  
  1408.     RXREC
  1409.     Usage    : rxrec [portname]
  1410.  
  1411.     Create an AREXX-compatible port of the specified name (defaults to
  1412.     "rexx_csh"), then puts Shell to sleep waiting for messages on it.
  1413.  
  1414.     CAUTION: the only way to exit from this status is to send to the port
  1415.     the message "bye".
  1416.  
  1417.     Example:
  1418.     Open two Shell's in two separate CLI's. From the first, type:
  1419.  
  1420.         rxrec
  1421.  
  1422.     Now first Shell doesn't respond to keyboard input; instead, it waits
  1423.     for messages on a port called "rexx_csh". Now, from the other, type:
  1424.  
  1425.         rxsend rexx_csh "dir df0:"
  1426.  
  1427.     You will see the listing of df0: in the first Shell. Experiment as you
  1428.     like, then:
  1429.  
  1430.         rxsend rexx_csh bye
  1431.  
  1432.     And all will return to normal.
  1433.  
  1434.     RXSEND
  1435.     Usage    : rxsend [-lr] portname command...command
  1436.  
  1437.     Send commands to any program with an AREXX-compatible port. Be aware
  1438.     that every word is sent as a single command!
  1439.  
  1440.     You don't have to load anything to use these command (or rxrec):
  1441.     all you need is a program with the right port.
  1442.  
  1443.     An example is CygnusEdProfessional: here is, for instance, a command
  1444.     to wake it up, load the file test.c and jump to line 20:
  1445.  
  1446.         rxsend rexx_ced cedtofront "open test.c" "jmp to line 20"
  1447.         # rexx_ced is the name of AREXX port for CygnusEd
  1448.  
  1449.     The option -r sets the variable _result to the result string
  1450.     of the AREXX command.
  1451.     The option -l send the whole line as *one* command.
  1452.  
  1453.     Refer to your application manual for details and for the names
  1454.     of the commands and the port.
  1455.  
  1456.     SEARCH
  1457.     Usage    : search [-abcefnqrvw] file...file string
  1458.  
  1459.     Search specified files for a string. Only lines containing the
  1460.     specified strings are displayed.
  1461.  
  1462.     If the filename is STDIN (in uppercase), the standard input is
  1463.     used, so you can use search as the destination for a pipe.
  1464.     Example:
  1465.         strings myprog 8 | search STDIN .library
  1466.     Lists all libraries used in "myprog".
  1467.  
  1468.     Search is very fast if none of the options -w, -e and STDIN was
  1469.     specified and the file fits into memory.
  1470.  
  1471.     Options:
  1472.       -a (abort)   stops search as soon as the pattern was found once
  1473.       -b (binary)  shows only byte offsets instead of lines. If combined
  1474.                    with -n, shows naked numbers. 
  1475.       -c (case)    turns ON case sensitivity
  1476.       -e (exclude) lists lines NOT containing the pattern
  1477.       -f (files)   causes only the names of the files in which the pat-
  1478.                    tern was found to be displayed.
  1479.       -l (left)    pattern must be at beginning of line (this is faster
  1480.                    than using a wild card)
  1481.       -n (number)  turns off line numbering
  1482.       -o (only)    finds only whole words
  1483.       -q (quiet)   suppresses printing of file names.
  1484.       -r (recurse) if you specify any directory, all files in that di-
  1485.                    rectory are recursively searched.
  1486.       -v (verbose) shows each file name on a single line. this is auto-
  1487.                    matically turned on if search is redirected
  1488.       -w (wild)    wild card matching. see notes below
  1489.  
  1490.     Notes to wild card matching;
  1491.     - Uses Shell standard matching.
  1492.     - All standard ARP wildcards are allowed * ? [] () | ~ ' #
  1493.     - The WHOLE line must match the string, not only a substring.
  1494.     - String MUST be enclosed in quotes to avoid wildcard expansion
  1495.  
  1496.     Examples:
  1497.         search -cr df0:include ACCESS
  1498.     Find all occurrencies of ACCESS (in uppercase) in all files
  1499.     contained in include directory.
  1500.         search -w shell.h "'#define*"
  1501.     Lists only lines of file beginning with (not simply containing)
  1502.     #define. Note the use of ' to escape the special symbol #.
  1503.  
  1504.     SET
  1505.     Usage    : set [name] [string]
  1506.     Example    : set abc hello
  1507.  
  1508.     Set with no args lists all current variable settings.
  1509.     Set with one arg lists the setting for that particular variable.
  1510.     Specifying name and string, stores the string into variable name.
  1511.  
  1512.     Also See the section on special _variables.
  1513.  
  1514.     SETENV
  1515.     Usage    : setenv envvar value
  1516.  
  1517.     Sets an ENV: variable to the given value. The value must be
  1518.     enclosed in quotes if it contains spaces.
  1519.  
  1520.     SLEEP
  1521.     Usage    : sleep timeout
  1522.     Example    : sleep 10
  1523.  
  1524.     Sleep for 'timeout' seconds, or until ^C typed.
  1525.  
  1526.     SPLIT
  1527.     Usage    : split srcvar dstvar...dstvar
  1528.  
  1529.     Assigns one word of srcvar to every dstvar, the rest of srcvar to
  1530.     the last dstvar.
  1531.     Note: You enter variable NAMES, not variables.
  1532.  
  1533.     STACK
  1534.     Usage    : stack [number]
  1535.     Example    : stack 8000
  1536.  
  1537.     Changes the default stack for this CLI. Without arguments, prints
  1538.     it.
  1539.  
  1540.     STRHEAD
  1541.     Usage    : strhead varname breakchar string
  1542.     Example    : strhead x . foobar.bas    # Will set x to "foobar"
  1543.  
  1544.     Remove everything after and including the breakchar in 'string' and
  1545.     place in variable 'varname'.
  1546.  
  1547.     STRINGS
  1548.     Usage    : strings file1..fileN minlenght
  1549.     Example    : strings c:dir c:list shell 7
  1550.  
  1551.     Prints strings contained in specified files (usually binary)
  1552.     with lenght >= minlenght.
  1553.  
  1554.     STRLEFT
  1555.     Usage    : strleft varname string n
  1556.     Example    : strleft x LongString 5    # Will set x to "LongS"
  1557.  
  1558.     Place leftmost n chars of string in variable varname.
  1559.  
  1560.     STRLEN
  1561.     Usage    : strlen varname string
  1562.     Example    : strlen x Hello        # Will set x to "5"
  1563.  
  1564.     Puts len of string in variable varname.
  1565.  
  1566.     STRMID
  1567.     Usage    : strmid varname string n1 [n2]
  1568.     Example    : strmid x LongString 5 3    # Will set x to "Str"
  1569.  
  1570.     Places n2 chars from string, starting at n1, in variable varname.
  1571.     By omitting n2, you get all chars from n1 to end of string.
  1572.  
  1573.     STRRIGHT
  1574.     Usage    : strright varname string n
  1575.     Example    : strright x LongString 5    # Will set x to "tring"
  1576.  
  1577.     Place rightmost n chars of string in variable varname.
  1578.  
  1579.     STRTAIL
  1580.     Usage    : strtail varname breakchar string
  1581.     Example    : strtail x . foobar.bas    # Will set x to "bas"
  1582.  
  1583.     Remove everything before and including the breakchar in 'string' and
  1584.     place in variable 'varname'.
  1585.  
  1586.     SOURCE
  1587.     Usage    : source file [arguments]
  1588.     Example    : source mymake.sh all
  1589.     Result    : barch file 'mymake.sh' called with var _passed = 'all'
  1590.  
  1591.     Execute commands from a file.  You can create SHELL programs in
  1592.     a file and then execute them with this command.  Source'd files
  1593.     have the added advantage that you can have loops in your command
  1594.     files (see GOTO and LABEL).  You can pass SOURCE files arguments
  1595.     by specifying arguments after the file name.  Arguments are passed
  1596.     via the _passed variable (as a single string, a set of words).
  1597.  
  1598.     Long lines may be split by appending a backslash (\) at end of
  1599.     first part. One single line must be shorter than 512 bytes, but
  1600.     the concatted line can be as long as you want. There is no limit
  1601.     on the length of the concatted line.
  1602.  
  1603.     Automatic 'sourcing' is accomplished by appending a .sh suffix to
  1604.     the file and executing it as you would a C program:
  1605.  
  1606.     --------- file hello.sh ---------
  1607.     foreach i ( $_passed ) "echo yo $i"
  1608.     ---------------------------------
  1609.  
  1610.     $ hello a b c
  1611.     yo a
  1612.     yo b
  1613.     yo c
  1614.  
  1615.     If the last character of a line in a source file is '{', all
  1616.     following lines will appended to the current one and separated
  1617.     by semicolons until the last character of a line is '}'. Those 
  1618.     blocks may be nested.
  1619.  
  1620.     --------- file login.sh ---------
  1621.     alias complex {
  1622.       echo -n "this   alias   "
  1623.       echo "works!"
  1624.     }
  1625.     ---------------------------------
  1626.  
  1627.     $ login
  1628.     $ complex
  1629.     this   alias   works!
  1630.  
  1631.  
  1632.     TACKON
  1633.     Usage    : tackon var pathname filename
  1634.     Example    : tackon x df0:c Dir    # sets x to "df0:c/Dir"
  1635.     or    : tackon x df0: Preferences #sets x to "df0:Preferences"
  1636.  
  1637.     Correctly  adds  a  filename  to a pathname, and puts the result in
  1638.     variable specified.
  1639.  
  1640.     TAIL
  1641.     Usage    : tail filename [num]
  1642.     Example    : tail readme 20
  1643.  
  1644.     Display  last  "num" lines of "filename".  If num is not specified,
  1645.     10 is assumed.
  1646.  
  1647.     TEE
  1648.     Usage    : tee [file]
  1649.     Example    : cc test.c | tee >error.list
  1650.  
  1651.     Copies stdin to stdout and the given file. If file is omitted, sterr
  1652.     is used.
  1653.  
  1654.     TOUCH
  1655.     Usage    : touch file1 .. fileN
  1656.  
  1657.     Sets DateStamp of the specified files to the current date & resets
  1658.     archive bit.
  1659.  
  1660.     TRUNCATE
  1661.     Usage    : truncate [n]
  1662.     Example : alias | sort | truncate
  1663.  
  1664.     A filter that truncates the width of stdin to the specified number,
  1665.     trying to account for tab's and escape sequences. If the number is
  1666.     omitted, the current window width is used.
  1667.  
  1668.     TYPE
  1669.     Equivalent to CAT.
  1670.  
  1671.     UNALIAS
  1672.     Usage    : unalias name .. name
  1673.     Example    : unalias vt
  1674.  
  1675.     Delete aliases..
  1676.  
  1677.     UNIQ
  1678.     Usage    : uniq
  1679.  
  1680.     This is a  filter that removes consecutive, duplicated lines in a
  1681.     file.  It is most useful on a sorted file.
  1682.  
  1683.     UNLOCAL
  1684.     Usage    : unlocal var ... var
  1685.  
  1686.     Deletes one or more local variables
  1687.  
  1688.     UNSET
  1689.     Usage    : unset name .. name
  1690.     Example    : unset abc
  1691.  
  1692.     Unset one or more variables.  Deletes them entirely.
  1693.  
  1694.     USAGE
  1695.     Usage    : usage [command...command]
  1696.  
  1697.     If called without arguments, usage gives you a short information
  1698.     on the special characters used. Otherwise, usage shows you the
  1699.     usage of the given commands. Calling a command with a '?' as
  1700.     the only argument will show its usage, too.
  1701.  
  1702.     VERSION
  1703.     Usage    : version
  1704.  
  1705.     Show current version name, & authors.
  1706.  
  1707.     WAITFORPORT
  1708.     Usage    : waitforport portname [seconds]
  1709.  
  1710.     Waits for a port to come up. Default time is 10 seconds.
  1711.  
  1712.     WHEREIS
  1713.     Usage    : whereis [-r] filename [ device1...deviceN ]
  1714.  
  1715.     If just a file name is given, cd searches all subdirectories of the
  1716.     current directory for that file. An asterisk '*' is appended to the
  1717.     file. Wild cards are allowed for the file (no asterisk will be
  1718.     appended then ), but no path names. If additional arguments are
  1719.     given, whereis searches only these paths, not the current directory.
  1720.     whereis -r looks on all drives.
  1721.  
  1722.     WINDOW
  1723.     Usage    : window [-q][-f][-b][-l][-s] [dimensions]
  1724.     Options    :
  1725.         -f    (front) Window to front
  1726.         -b    (back)  Window to back
  1727.         -l    (large) Window to maximum size
  1728.         -s    (small) Window to minimum size
  1729.         -a    (activate)
  1730.         -q    (query) Lists screens and windows open
  1731.  
  1732.        Various  operations on CLI window.  If dimensions are specified,
  1733.     they must be in the form x y width height, with values separated by
  1734.     spaces.
  1735.        The  command  "window  -l" may be very useful on PAL machines to
  1736.     get  a  full  PAL  window  from  your login sequence, or if you use
  1737.     overscan WorkBench.
  1738.        Option  -q  gives,  for  each  Screen and Window currently open,
  1739.     title, left edge, top edge, width, height.
  1740.  
  1741.  
  1742. IX. SPECIAL SET VARIABLES
  1743. -------------------------
  1744.  
  1745.     _abbrev
  1746.     If set to 'n', internal commands can no longer be abbreviated.
  1747.  
  1748.     _bground
  1749.     True if the shell was started with a non-interactive input.
  1750.  
  1751.     _clinumber
  1752.     Contains the number (1-20) of current CLI.
  1753.  
  1754.     _cwd
  1755.     Holds a string representing the current directory we are in from
  1756.     root.  The SHELL can get confused as to its current directory if
  1757.     some external program changes the directory.  Use PWD to rebuild
  1758.     the _cwd variable in these cases.
  1759.  
  1760.     _debug
  1761.     Debug mode... use it if you dare.  must be set to some value
  1762.  
  1763.     _every
  1764.     Contains the name of a command that is output every time just before
  1765.     the prompt is printed. Do not use this to echo the prompt.
  1766.  
  1767.     _except
  1768.     See EXCEPTION
  1769.  
  1770.     _hilite
  1771.     Holds the font attributes used for highlighting. One letter for one
  1772.     attribute:
  1773.       b    for bold
  1774.       i    for italic
  1775.       u    for underlined
  1776.       r    for reverse
  1777.       c3   for foreground color 3
  1778.       c3,2 for foreground color 3 and background color 2
  1779.     Any combinations are allowed. _hilite defaults to "c7", in terminal
  1780.     mode to "r".
  1781.  
  1782.     _history
  1783.     This variable is set to a numerical value, and specifies how far
  1784.     back your history should extend. Set it to 0 to disable history,
  1785.     for example if you test your programs for memory leaks. Defaults
  1786.     to 50.
  1787.  
  1788.     _insert
  1789.     Sets the default for insert/overtype mode for command line
  1790.     editing. ^A toggles between, but after <RET> the default is
  1791.     set back as indicated by this variable. By default _insert is 1
  1792.     indicating insert mode on setting to zero will make overtype
  1793.     the default.
  1794.  
  1795.     _ioerr
  1796.     Contains the secondary error code for the last command. Will be
  1797.     changed after every external command and after a failed internal
  1798.     command. See @ioerr( )
  1799.  
  1800.     _kick2x
  1801.     True if dos.library V36 could be opened (which means that kickstart
  1802.     2.0 is around)
  1803.  
  1804.     _lasterr
  1805.     Return code of last command executed.  This includes internal
  1806.     commands as well as external comands, so to use this variables
  1807.     you must check it IMMEDIATELY after the command in question.
  1808.  
  1809.     _lcd
  1810.     Holds the name of the last directory. The builtin alias 'dswap'
  1811.     cd's to that directory. If called again, you're back where you
  1812.     were.
  1813.  
  1814.     _man
  1815.     The path and name of your .doc file. Defaults to 'csh:csh.doc'
  1816.  
  1817.     _maxerr
  1818.     The worst (highest) return value to date.  To use this, you usually
  1819.     set it to '0', then do some set of commands, then check it.
  1820.  
  1821.     _minrows
  1822.     Gives the minimum number of rows a window must have to turn on quick
  1823.     scrolling. Defaults to 34.
  1824.  
  1825.     _nobreak
  1826.     If set to some value, disables CTRL-C.
  1827.  
  1828.     _noreq
  1829.     If set to some value , disables system requesters ("Please insert
  1830.     volume ...."). Turned on in vt200 mode.
  1831.  
  1832.     _passed
  1833.     This variable contains the passed arguments when you SOURCE a file
  1834.     or execute a .sh file.  For instance:
  1835.  
  1836.     test a b c d
  1837.  
  1838.     -------- file test.sh ----------
  1839.     echo $_passed
  1840.     foreach i ( $_passed ) "echo YO $i"
  1841.     --------------------------------
  1842.  
  1843.     _path
  1844.     Tells CShell where to look for executable files. The current direc-
  1845.     tory and the AmigaDOS path will be searched first. The trailing
  1846.     slash for directories is not necessary anymore.  The entire path
  1847.     will be searched first for the <command>, then for <command>.sh
  1848.     (automatic shell script sourcing). Example:
  1849.         set _path ram:c,ram:,sys:system,dh1:tools,df0:c
  1850.     (This path has the advantage that these directories need not even
  1851.      exist, that you can access devices (AmigaDOS path only knows 
  1852.      volumes under Kick 1.3) and that no disk seeks happen at startup)
  1853.  
  1854.     _prompt
  1855.     This variable now can contain the following control characters:
  1856.      %c  for color change. This highlights your prompt. See _hilite
  1857.      %m  for memory. This shows your current memory in K
  1858.      %t  for time. This shows your current time in the format HH:MM:SS
  1859.      %d  for date. This shows the current date in the format DD-MMM-YY
  1860.      %p  for path. This inserts the current path
  1861.      %n  for number. This inserts the current process number
  1862.      %v  for version. This shows the version number of CShell
  1863.      %h  for history. This displays the current history number
  1864.      %f  for free store. This shows the free store on the current drive
  1865.      %r  for pRiority. Inserts the task priority of the current
  1866.     The default for prompt is now "%c%p> "
  1867.     The  if  command  will  set the prompt to a '_ ' if commands are
  1868.     disabled while waiting for a 'endif' or 'else' command (interactive
  1869.     mode only.
  1870.  
  1871.     _pipe
  1872.     The directory where temporaries are stored. Default: 'T:'
  1873.  
  1874.     _qcd
  1875.     Holds the name of the file where the all directories on your hard 
  1876.     disk are stored. If not set, defaults to csh:csh-qcd.
  1877.  
  1878.     _rxpath
  1879.     The same as with _path, but this is where CShell looks for .rexx
  1880.     files. Defaults to REXX:
  1881.  
  1882.     _scroll
  1883.     Holds the number of lines to be scrolled at once when quick scrolling
  1884.     is used. If unset or <=1, quick scrolling is off. Defaults to 3.
  1885.  
  1886.     _terminal
  1887.     Indicated whether or not shell was started in terminal mode.
  1888.  
  1889.     _titlebar
  1890.     The same control characters as for the _prompt can be used for
  1891.     _titlebar, too. The only difference is that %c is ignored. The
  1892.     titlebar is updated every time before the prompt appears.
  1893.  
  1894.     _verbose
  1895.     If set to 's', turns on verbose mode for source files (every command
  1896.     will be displayed before being executed). If set to 'a', displays
  1897.     all substeps while alias substitution. 'h' will hilight the debug
  1898.     output. Any combination allowed: set _verbose sah
  1899.  
  1900.     _version
  1901.     Contains the version number of the shell, e.g. 510.
  1902.  
  1903.  
  1904. X.   FUNCTIONS
  1905. --------------
  1906.  
  1907.     FUNCTIONS
  1908.     Functions are preceded by an @-sign and may not be abbreviated
  1909.     They must be preceded by a blank amd a blank must follow the opening
  1910.     and precede the closing brace. There must be no blank between the
  1911.     function name an the opening brace.
  1912.     (NOTE: Later versions of Shell might allow that functions need not
  1913.            be at the beginning of an argument, so quote any @-signs not
  1914.            used for functions)
  1915.  
  1916.     Functions may be nested. The function names themselves are case
  1917.     sensitive, but the operations (like strcmp) aren't.
  1918.  
  1919.     Functions can be used as commands. They will echo their return value
  1920.     to stdout. Note that they can't be abbreviated and that the function
  1921.     list is searched after the command list. Example:
  1922.         drives          ---> DF0: DH1: DH2: RAM: WB_2.x:
  1923.  
  1924.     So far, functions are not user definable.
  1925.  
  1926.     Note the difference between sets of words and strings. After
  1927.       set var hello world
  1928.     $var is a wordset, but after
  1929.       set var "hello world"
  1930.     var is one string. Although they look the same if echoed, they
  1931.     behave different, for example in 'foreach i ( var ) "echo hi'. The
  1932.     functions @split and @concat convert the two forms.
  1933.  
  1934.  
  1935.     @abbrev( str1 str2 [len] )
  1936.     true if the first <len> chars of str1 are an abbreviation of str2
  1937.     @abs( num )
  1938.     returns absolute value of <num>
  1939.     @age( file )
  1940.     the age of that file in days, 99999 if file not found
  1941.     @appsuff( name suffix )
  1942.     appends an suffix ( .ZOO ) to a string if it's not already there
  1943.     @arg( arg ... arg )
  1944.     see @pickargs( )
  1945.     @availmem( [type] )
  1946.     returns free 'chip', 'fast' or otherwise total memory
  1947.     @basename( file )
  1948.     returns the file name of <file> without path
  1949.     @center( word len )
  1950.     returns a string of length <len> with <word> centered in it
  1951.     @checkport( portname )
  1952.     indicates if given port exists
  1953.     @clinum( procname )
  1954.     returns the number of the cli identified by a name or a number
  1955.     @complete( abbrev word ... word )
  1956.     returns the first word <abbrev> is an abbreviation of
  1957.     @concat( word word ... word )
  1958.     concats all words in one blank separated string, see @split
  1959.     @confirm( title item ... item )
  1960.     asks for confirmation of every item and returns the confirmed ones
  1961.     @console( STDIN|STDOUT )
  1962.     tells whether stdin or stdout are interactive (not redirected)
  1963.     @dectohex( number )
  1964.     returns a string representing <number> in hex
  1965.     @delword( word word ... word n )
  1966.     returns a string with the n-th word deleted.
  1967.     @delwords( word word ... word n m )
  1968.     deletes the next m words from the n-th.
  1969.     @dirs( name name name name )
  1970.     returns the directories among the given file names, see @files
  1971.     @drive( path )
  1972.     outputs the drive ( device ) name associated to <path>
  1973.     @drives( )
  1974.     outputs all available drives
  1975.     @exists( file )
  1976.     tells whether a file exists or not
  1977.     @fileblks( file file ... file )
  1978.     returns the # of blocks needed for the files, incl. dir blocks
  1979.     @filelen( file file ... file )
  1980.     count the total number of bytes of the given files
  1981.     @fileprot( file )
  1982.     returns a string like ---arwed
  1983.     @filereq( title path&pattern filename )
  1984.     brings up the arp file requester and returns the selected file name
  1985.     @files( file file ... file )
  1986.     gives you the files among those names, no directories. see @dirs
  1987.     @freebytes( path )
  1988.     the number of free bytes on the given path
  1989.     @freeblks( path )
  1990.     the number of free blocks on the given path
  1991.     @freestore( path )
  1992.     the amount of free store on that path, given in K, M and G
  1993.     @getenv( varname )
  1994.     returns the value of the named env: variable
  1995.     @getclass( file )
  1996.     returns the class (type) of the file. See chapter XIV
  1997.     @howmany
  1998.     indicates the # of shells running
  1999.     @index( string pattern )
  2000.     returns the index of pattern in string (starting at 1), 0 if not found
  2001.     @info( path )
  2002.     the corresponding line from the 'info' command, each entry a word
  2003.     @intersect( word1 word2 word3 , word4 word5 word6 )
  2004.     returns all words which are in both lists. see @union, @member
  2005.     @ioerr( num )
  2006.     returns the corresponding error string to num
  2007.     @lookfor( file paths )
  2008.     looks for a file in the current directory and the paths. See $_path
  2009.     @lower
  2010.     lowercases its arguments. see @upper
  2011.     @match( word ... word "pattern" )
  2012.     returns the words in the list that match the arp-pattern
  2013.     @max( num num ... num )
  2014.     computes the maximum of all given numbers
  2015.     @megs( number )
  2016.     expresses a number in K, M and G (-bytes), rounded correctly
  2017.     @member( word1 word word ... word )
  2018.     tells you if word1 is among the remaining words
  2019.     @min( num num ... num )
  2020.     computes the minimum of all given numbers
  2021.     @mounted( device )
  2022.     returns a boolean indicating whether the specified device is mounted
  2023.     @nameext( filename )
  2024.     returns all after the last dot of <filename>.
  2025.     @nameroot( filename )
  2026.     returns all before the LAST dot of <filename>.
  2027.     @opt( arg ... arg )
  2028.     see @pickopts( )
  2029.     @pathname( path )
  2030.     strips the base name from a path
  2031.     @pickargs( arg ... arg )
  2032.     picks of its arguments those which don't start with a '-'
  2033.     @pickopts( arg ... arg )
  2034.     picks of its arguments those which start witch a '-'
  2035.     @rpn( expression )
  2036.     computes the rpn expression. See rpn command
  2037.     @sortargs( name ... name )
  2038.     sorts its arguments alphabetically
  2039.     @sortnum( number ... number )
  2040.     sorts its arguments numerically
  2041.     @split( string )
  2042.     makes each blank separated part of @string a word, see @concat
  2043.     @strcmp( name name )
  2044.     returns -1, 0 or 1 depending of alphabetical comparison
  2045.     @strhead( breakchar string )
  2046.     see strhead command
  2047.     @strleft( string number )
  2048.     see strleft command
  2049.     @strmid( string n1 n2 )
  2050.     see strmid command
  2051.     @strright( string n )
  2052.     see strright command
  2053.     @strtail( breakchar string )
  2054.     see strtail command
  2055.     @subwords( word ... word n m )
  2056.     returns the next m words word of the given list starting from n
  2057.     @tackon( path file )
  2058.     see tackon command
  2059.     @unique( word ... word )
  2060.     sorts the arguments and makes each of them unique
  2061.     @union( name ... name , name ... name )
  2062.     returns all names that are in either list. See @intersect, @member
  2063.     @upper( word ... word )
  2064.     upper cases the given words. see @lower
  2065.     @volume( path )
  2066.     returns the volume name in that path or "" (no colon appended)
  2067.     @winheight( )
  2068.     outputs the height of your window in pixels
  2069.     @winleft( )
  2070.     returns the left edge of your window
  2071.     @wintop( )
  2072.     returns the top edge of your window
  2073.     @winwidth( )
  2074.     outputs the width of your window in pixels
  2075.     @without( name ... name , name ... name )
  2076.     returns all names of list 1 that are not in list 2
  2077.     @word( name ... name n )
  2078.     picks the n-th word from the list.
  2079.     @words( name ... name )
  2080.     returns the number of words in the list.
  2081.  
  2082.  
  2083. XI. MISCELLANEOUS
  2084. -----------------
  2085.  
  2086.     QUICK SCROLLING
  2087.     CShell has now allows to do quick scrolling in large windows.
  2088.     Quick scrolling means that whenever the cursor reaches the bottom
  2089.     of the window, the text jumps up 3 or more lines at once. However,
  2090.     only the following commands support this (yet):
  2091.     - dir, cat, htype, strings, search, truncate, tee
  2092.     You can choose the number of lines to scroll at once by setting
  2093.     the variable _scroll. Unsetting it or setting it to a value <=1
  2094.     completely disables quick scrolling.
  2095.     You can also choose the number lines a window must at least have
  2096.     to turn on the quick scrolling by setting the _minrows variable.
  2097.     (Defaults to 34). Quick scrolling is automatically disabled when
  2098.     the command is redirected. By piping any command to cat, you can
  2099.     force it to quick scroll. Example:  List | cat
  2100.  
  2101.  
  2102.     CLOSING GADGET
  2103.     CShell now can be terminated using the closing gadget in the
  2104.     AmigaDOS 2.0 shell window. Don't execute c:ENDCLI while using
  2105.     the shell. This can cause problems with external commands. The
  2106.     closing button provides a 'quit' command. You can define
  2107.       alias quit "Endcli;\\quit
  2108.     to assert that the CLI window closes when you click the button.
  2109.  
  2110.  
  2111.     EXCEPTION PROCESSING
  2112.     If  no  _except variable exists, any command which fails causes the
  2113.     rest of the line to abort as if an ABORTLINE had been executed.  If
  2114.     the _except variable exists, it is of the form:
  2115.  
  2116.     "nnn;commands..."
  2117.  
  2118.     where  nnn  is  some  value  representing  the  minimum return code
  2119.     required  to  cause  an  error.   Whenever a command returns a code
  2120.     which  is  larger  or  equal  to  nnn,  the commands in _except are
  2121.     executed  before  anything.   WHEN _except EXISTS, THE COMMAND LINE
  2122.     DOES  NOT  ABORT AUTOMATICALLY.  Thus, if you want the current line
  2123.     being executed to be aborted, the last command in _except should be
  2124.     an "abortline".
  2125.  
  2126.     Exception  handling  is  disabled  while  in the exception handling
  2127.     routine (thus you can't get into any infinite loops this way).
  2128.  
  2129.     Thus if _except = ";", return codes are completely ignored.
  2130.  
  2131.     Example:
  2132.  
  2133.     set _except "20;abortline"
  2134.  
  2135.  
  2136. XII. EXAMPLE SOURCE FILES
  2137. -------------------------
  2138.  
  2139. If from a CLI or the startup-script you say 'SHELL filename', that file is
  2140. sourced first.
  2141.  
  2142. ### compat.sh ###
  2143.  
  2144. # this makes sure that your old abbreviations don't call new commands
  2145.  
  2146. alias as  aset
  2147. alias cl  close
  2148. alias g   goto
  2149. alias h   help
  2150. alias he  help
  2151. alias m   md
  2152. alias q   quit
  2153. alias re  rename
  2154. alias w   window
  2155.  
  2156. alias kr  "rm -r ram:* >NIL:
  2157.  
  2158. ### End of compat.sh ###
  2159.  
  2160.  
  2161. Moreover, if you have a file called S:.login, it will be sourced for every
  2162. Shell you run. This is useful for aliases and setting that you want in ALL
  2163. Shells.
  2164.  
  2165.  
  2166. ### Example S:.login ###
  2167.  
  2168. Here is an example .login file:
  2169.  
  2170. set F5 "cdir WORK:"^M
  2171. set f9 "ed s:login.sh"^M
  2172. set F9 "ed df0:s/startup-sequence"^M
  2173.  
  2174. alias toram  "%q foreach i ( $q ) \"cp -r $i: ram:$i >NIL:;assign $i: ram:$i
  2175. alias ramop  "md RAM:op; assign OP: ram:op
  2176. alias noop   "assign OP: ; rm -r ram:op
  2177. alias newop  "rm -r OP:*
  2178. alias dc     "dfc df0: to df1:
  2179. alias go     "%q assign WORK: Boot:$q; cd WORK:; source startme.sh
  2180. alias get    "%q cp $q RAM: >NIL:
  2181. alias filter "%a%b%c exec $b \\<$a \\>$c
  2182.     # reads $a, filters it with $b and writes result to $c
  2183.  
  2184. alias rm     "%q \\rm @confirm( Remove $q )
  2185.  
  2186. #alias rm     "%a set f @pickargs( $a );set opts @pickargs( $a );\
  2187. # e -n OK to delete @words( @files( $f ) ) file(s) and @words( @dirs( $f ) )\
  2188. # directories\"? \";input b;if $b = y;\\rm $opts $f;endif 
  2189. #        # for the anxious among us: confirmed rm
  2190.  
  2191. set _prompt   "%c%p> "
  2192.     # this puts the path highlighted in the prompt
  2193.  
  2194. # this one puts cli number, free mem, date and time in title bar
  2195. set _titlebar "Shell %n    Mem %m     Date %d    Time %t
  2196.  
  2197. # This file will be sourced for every Shell you start
  2198.  
  2199. ### End of example .login ###
  2200.  
  2201. ****************************************************************************
  2202.  
  2203. If you are a CLI user, your startup-sequence may be as simple as:
  2204.  
  2205.     C:csh S:startup.sh
  2206.  
  2207. Here's a startup code:
  2208.  
  2209. ### Example S:startup.sh ###
  2210.  
  2211. wind -l    # if you are on a PAL machine, or use overscan
  2212.     # note that commands may be abbreviated (wind=window)
  2213.  
  2214. assign LC: Stuff:c  INCLUDE: Stuff:include   LIB: Boot:lib   QUAD: RAM:
  2215.  
  2216. rback C:FaccII; sleep 1
  2217.     # after spawning a process, it is always better to allow it
  2218.     # to load the command, to avoid excessive drive head movement
  2219.  
  2220. resident -d blink lc1 lc2 >NIL:    #defer loading
  2221.  
  2222. C:PopCli 300 C:Newcli         #using full pathname loads faster
  2223. C:FF -1 Siesta.font >NIL:
  2224. C:Patch_1 >NIL:
  2225. stack 8000            # lc1 and lc2 need this
  2226.  
  2227. source S:setdate.sh        # this is listed next 
  2228.  
  2229. ### End of example startup.sh ###
  2230.  
  2231. ****************************************************************************
  2232.  
  2233. The following is an example source file to set date and time; it may be
  2234. used at startup if you don't have an internal clock.
  2235.  
  2236. ### setdate.sh ###
  2237.  
  2238. open CON:200/100/440/80/SetDate write 1
  2239. echo >.1 -n "Current date is "
  2240. date >.1
  2241. echo >.1 -n "Please enter date: "
  2242. input <.1 d
  2243. close 1
  2244. strlen len $d
  2245. if $len > 1 ; date $d ; endif
  2246. echo -n "New date: " ; date
  2247.  
  2248. ### End of setdate.sh ###
  2249.  
  2250. ***************************************************************************
  2251.  
  2252. Next comes a makefile that needs no Make program: may be executed from
  2253. Shell directely!!!
  2254.  
  2255. ### make.sh ###
  2256.  
  2257. if -t Shell.syms Shell.h; cc +HShell.syms Shell.h; rm shell.o; endif
  2258. if -t RAM:Shell.syms Shell.syms; cp -d Shell.syms RAM:; endif
  2259.  
  2260. foreach i ( main comm1 comm2 comm3 execom globals rawconsole run set \
  2261.  sub ) "if -t $i.o $i.c; echo Compile $i...;cc +IRAM:shell.syms $i.c; endif"
  2262.  
  2263. # we used line continuation for better visibility. this is not necessary,
  2264. # you can type it all in one line. no more limit of 256 bytes per line
  2265.  
  2266. if -t Shell run.o main.o comm1.o comm2.o comm3.o execom.o \
  2267. set.o sub.o globals.o rawconsole.o
  2268.     ln  +q -m -o Shell run.o main.o comm1.o comm2.o comm3.o\
  2269.     execom.o set.o sub.o globals.o rawconsole.o -la -lc
  2270. endif
  2271.  
  2272. ### End of make.sh ###
  2273.  
  2274.  
  2275. XIII.  Default Values
  2276. --------------------
  2277.  
  2278. Some aliases are predefined whenever you start a new Shell. These are:
  2279.  
  2280.     CDIR
  2281.     Use "cdir directory" to clear the screen, set CD to directory,
  2282.     and list it.
  2283.  
  2284.     CLS
  2285.     Simply clear the screen.
  2286.  
  2287.     DSWAP
  2288.     Exchanges current and the previous current directory. For use in
  2289.     scripts as the symbol for last current directory may change.
  2290.  
  2291.     EXIT
  2292.     Leave Shell and exit CLI.
  2293.  
  2294.     MANLIST
  2295.     Display  a list of possible arguments to man.  You can pipe this to
  2296.     qsort to get a sorted output.
  2297.  
  2298. Moreover, many variables have default values, and many function keys are
  2299. predefined. You can use set command to determine all of these.
  2300.  
  2301. XIV.  Object oriented features
  2302. ------------------------------
  2303.  
  2304.     CLASSES OF FILES
  2305.  
  2306.     You can define a class of files using several 'class' commands.
  2307.     Here a simple example:
  2308.  
  2309.       class picture  suff=.pic suff=.iff suff=.ilbm 
  2310.       class anim     suff=.anim
  2311.  
  2312.     From now on, everything with the suffix .pic, .iff or .ilbm will
  2313.     be identified as a picture. Please note that there may be no blanks
  2314.     between the names and the '=', and that blanks inside the names
  2315.     must be put in quotes. So these are the ways to identify a file:
  2316.  
  2317.       suff=.doc        True if the suffix of the file is .doc
  2318.       name=readme      True if the file is "readme"
  2319.       name="mod.*"     True if the name starts with 'mod.'
  2320.       offs=14,DC..C4FD True if the bytes starting at $14 are $DC,
  2321.                        anything, $C4, $FD  (all numbers hexadecimal!). 
  2322.                        Each pair of dots means one byte ignored.
  2323.       chars            True if 90% of the bytes in the file are 32..127
  2324.                        or 9..13
  2325.       default          Always true, used to define the default type
  2326.  
  2327.     Note that only the first character is examined, so 's' = 'suff'.
  2328.     One class can be identified by more than one 'class' statement.
  2329.     They are looked at in the same sequence they were entered. So to
  2330.     make sure that an zoo archive misnamed as .lzh is identified
  2331.     correctly, use the following 'class' statements:
  2332.  
  2333.       class zoo offs=14,DCA7C4FD
  2334.       class lzh offs=2,2D6C68..2D
  2335.       class zoo suff=.zoo
  2336.       class lzh suff=.lzh
  2337.  
  2338.     Moreover, there is a builtin class 'dir', which means directory.
  2339.     Now we know many file types. But what to do with them? This is
  2340.     where we define 'actions'.
  2341.  
  2342.     ACTIONS ON CLASSES
  2343.  
  2344.     There may be one or more 'class' commands that define what actions
  2345.     need to be taken in various cases for that specific class:
  2346.  
  2347.       class zoo actions view="zoo -list" extr="zoo -extract"
  2348.       class lzh actions view="lz l"      extr="lz e"
  2349.  
  2350.     Whenever somebody tries to 'view' a test.zoo, the command
  2351.     'zoo -list test.zoo' will be issued, but if he tries to
  2352.     view test.lzh, then 'lz l test.lzh' will be executed. Note
  2353.     that any command supplied here goes through the normal csh
  2354.     parser, so AmigaDOS and csh paths will be searched. Aliases
  2355.     with arguments are allowed here, too, so whatever the user
  2356.     typed will be stored in the variable after the '%'.
  2357.  
  2358.     How do I tell a file that I want to 'view' it? There comes the
  2359.     second command used for object oriented features:
  2360.  
  2361.       action view test.zoo
  2362.  
  2363.     will first identify the type of that file and then apply, if
  2364.     possible, the 'view' action to it. Of course, this works best
  2365.     inside an alias:  alias v "action view" will define a v-command
  2366.     that views all types of files known to cshell. Similarly, you
  2367.     can define   alias xtr "action extr" and use this command to
  2368.     extract files from any type of archive.
  2369.     There is one action that will be sent to every file that you
  2370.     try to start but is not executable. This action is 'exec'. 
  2371.     Assume you have defined the class 'picture', then after
  2372.  
  2373.       class picture actions view=Mostra exec=Mostra
  2374.  
  2375.     you can display a picture using Mostra by just typing its name.
  2376.     More builtin actions like 'rm' and 'dir' may be implemented,
  2377.     so don't use command names for action names.
  2378.  
  2379.     The batch file class.sh defines a few useful classes.
  2380.  
  2381.  
  2382.  
  2383. XV.     Keymaps
  2384. ---------------
  2385.  
  2386.     You define a keymap as a collection of key/function pairs. Both
  2387.     are given as numbers. There can be several keymaps which activate
  2388.     each other, but at first we only edit keymap 0, which is active
  2389.     at the beginning. All keys you define will eventually overwrite
  2390.     the old definitions in an existing keymap. Everithing marked with
  2391.     a (*) is not yet implemented.
  2392.  
  2393.     KEYCODES
  2394.  
  2395.     1..255    The corresponding ASCII character
  2396.     256      Up Arrow
  2397.     257      Down Arrow
  2398.     258      Right Arrow
  2399.     259      Left Arrow
  2400.     260      Help
  2401.     261..270  F1..F10  (unshifted)
  2402.  
  2403.  
  2404.     Modifiers (add them to the key code)
  2405.  
  2406.     512       SHIFT (only necessary for arrows and fkeys)
  2407.     1024      ESC   (was pressed & released before this key)
  2408.  
  2409.     EDITFUNCTIONS
  2410.  
  2411.     - Movement      Move cursor...
  2412.      0  CursLeft    1 left
  2413.      1  CursRight   1 right
  2414.      2  WordLeft    1 word left
  2415.      3  WordRight   1 word right
  2416.      4  BegOfLine   to beginning of line
  2417.      5  EndOfLine   to end of line
  2418.  
  2419.     - Deleting      Delete...
  2420.     10  Backspace   char left from cursor
  2421.     11  Delete      char right from cursor
  2422.     12  BkspcWord   word left from cursor
  2423.     13  DelWord     word right from cursor
  2424.     14  DeleteToSOL to start of line
  2425.     15  DeleteToEOL to end of line
  2426.     16  DeleteLine  whole line
  2427.  
  2428.     - History insert
  2429.     20  Back        Move one line back in history
  2430.     21  Forward     Move one line forward in history
  2431.     22  Beg         Move to first line in history
  2432.     23  End         Move to last line in history
  2433.     24  Complete    History retrieve like '!'
  2434.     25  Exec        Execute history line & bring up next
  2435.     26  Tail        Insert previous line except first word
  2436.     27  Bottom      Go below last history command
  2437.     28  DupWord     Duplicates the last word on this line
  2438.  
  2439.     - Completion
  2440.     30  Normal      Insert first matching file (or cycle)
  2441.     31  Partial     Insert substring of all matching files
  2442.     32  All         Insert all matching files
  2443.     33  Directory   Find dir in quick cd list
  2444.     34  LastCD      Insert last current directory
  2445.  
  2446.     - Special
  2447.     40  Insert      Toggle Insert/Overwrite
  2448.     41  Quit        Silently perform 'quit'
  2449.     42  Help        Silently perform 'help'
  2450.     43  Refresh     Redraw current line
  2451.     44  Execute     Execute current line
  2452.     45  Leave       Edit new line, store this in hist
  2453.     46  EOF         Terminate shell
  2454.     47  NOP         Do nothing
  2455.     48  Echo^O      Echoes a ^O
  2456.     49  Beep        Echoes a ^G
  2457.  
  2458.     - Other
  2459.     50  Fkey        Execute command associated to last fkey
  2460.     51  Menu        Execute command associated to last menu
  2461.     52  Undo        Undoes last edit
  2462.     53  Repeat      Repeats last function
  2463.  
  2464.  
  2465.     Command types
  2466.  
  2467.     0   +x      Editing function x, see above descriptions
  2468.     512 +x      Setmap x,     x=0..7
  2469.     1024+x      Insert key x, x=1..255
  2470.     1536+x      Macro x       x=1..15         (*)
  2471.     2048+x      String x      x=1..15         (*)
  2472.