home *** CD-ROM | disk | FTP | other *** search
/ Frozen Fish 1: Amiga / FrozenFish-Apr94.iso / bbs / alib / d5xx / d512 / csh.lha / Csh / Csh.doc < prev    next >
Text File  |  1991-07-20  |  86KB  |  2,526 lines

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