home *** CD-ROM | disk | FTP | other *** search
/ World of A1200 / World_Of_A1200.iso / programs / system / csh / csh.doc < prev    next >
Text File  |  1995-02-27  |  112KB  |  3,324 lines

  1.  
  2.         INSTRUCTIONS FOR C-SHELL VERSION: 5.39   October 1994
  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.     XVI.    Scrolling
  25.  
  26.  
  27.  
  28. O.  Installation
  29. ----------------
  30.  
  31. This program requires at least AmigaOS 2.04 (KS37.175, WB37.67) or higher.
  32.  
  33. For  online  help  inside csh, assign CSH:  somewhere and put csh.doc there.
  34. Then  you can use the 'man' command for any desired command.  Press the HELP
  35. key for a command list.
  36.  
  37. You  can  simply  invoke  csh  from  the  command line or at the end of your
  38. startup-sequence,  because  csh is, from the AmigaDOS standpoint, not a true
  39. shell  like  l:shell-seg.   Nevertheless, csh is 'pure', so if your archiver
  40. forgot to set the 'p' bit, do it right now.
  41.  
  42. Proposed final setup:  If you want to make csh resident, do the following:
  43.  
  44.   1. Copy csh anywhere on your (hard)disk, e.g. dh1:tools
  45.   2. Make sure your s:startup-sequence contains:
  46.     resident dh1:tools/csh add
  47.     csh
  48.   4. In s:.login, put any commands to be called only once, like setmap,
  49.     assign, setclock. This is a shell script, use # for comments, and
  50.     don't use .key type commands.
  51.   5. In s:.cshrc, you put any commands that need to be executed on every
  52.     invocation, like 'alias', 'set' and so on.
  53.   6. Put the following to s:cli-startup and s:shell-startup, so csh will be
  54.     started in any window opened by NewCLI, NewShell or from workbench:
  55.         csh
  56.         endcli
  57.  
  58.  
  59. Additionally,  I  recommend  to assign CSH:  somewhere and put your docs and
  60. CShell scripts there.  You can do the assign from inside the shell, it's not
  61. needed at startup.
  62.  
  63. The file s:.cshrc is executed on every startup (of csh) if it exists,
  64. the file s:.login only on csh's first invocation after boot-time,
  65. the file s:.logout is executed on every termination (of csh).
  66.  
  67.  
  68.  
  69. I.  DESCRIPTION
  70. ---------------
  71.  
  72. This version of Shell is the successor of:
  73.     Shell V2.04 (C)Copyright 1986, Matthew Dillon, All Rights Reserved
  74.     Shell V2.04M-V2.07M by Steve Drew
  75.     Shell V2.08MI, V3.xxA and V4.xxA by Carlo Borreo & Cesare Dieni
  76.     Shell V5.xxL by U. Dominik Mueller
  77.     Shell V5.20+ by Andreas M. Kirchwitz
  78.  
  79.  
  80.  
  81. Responsible for the V5.20+ series of Cshell is:
  82.  
  83.      Andreas M. Kirchwitz
  84.      Seesener Str. 69, D-10709 Berlin, Germany
  85.      UUCP/InterNet: csh-fan@zikzak.in-berlin.de
  86.  
  87. Send wishes, detailed bug reports (and the beer bottles :) to the above
  88. address. I need your Csh version number and a reproducable bug generation
  89. example.
  90.  
  91. If you report Enforcer hits please send the complete Enforcer and SegTracker
  92. output. Otherwise it's of no earthly use.
  93.  
  94. The V5.20+ series is an ARP-free, OS-2.x-only pre-6.0 version of Cshell.
  95. It only has an english ascii-doc, but it sweetens the time until Csh 6.x
  96. (by Urban Mueller) is available ;-)
  97.  
  98.  
  99.  
  100. If you have any wishes, bug reports or beer bottles, send them to:
  101.  
  102.        FIDONET :  Urban Mueller@2:302/906 (AUGL)
  103.        INTERNET:  umueller@amiga.icu.net.ch
  104. or
  105.        U. Dominik Mueller
  106.        Schulhausstrasse 83
  107.     CH-6312 Steinhausen
  108.        SWITZERLAND
  109.  
  110. Any sign of intelligent life welcome! German, English and French spoken.
  111.  
  112. Please check the 'restrictions' chapter before reporting any bugs and add
  113. your CShell version and a description of your configuration.
  114.  
  115. You may distribute this program unmodified and for non-profit only.
  116.    *** YOU MAY NOT MODIFY THIS PROGRAM AND REDISTRIBUTE IT ***
  117. Please contact me if you want to make changes.
  118.  
  119.  
  120. AVAILABILITY
  121. ------------
  122.  
  123. CShell can always be downloaded at the AUGL BBS.  Some additionals parts
  124. (French documentation) are available there, too.
  125.  
  126. For those who want to get it per FIDO file request, the archive is always
  127. named like 'csh513.lzh' for CShell 5.13 and 'csh513s.lzh' for its source.
  128.  
  129. CShell is available via FTP from AmiNet (and mirrors) in the directory
  130. /pub/amiga/shell/ (the archive names are the same) and via UUCP/Internet-
  131. EMail from "mail-server@cs.tu-berlin.de" in the same directory.
  132.  
  133.  
  134. CREDITS
  135. -------
  136.  
  137. Arexx is a program by William Hawes.
  138. Cygnus Ed Professional (C) 1988 CygnusSoft Software.
  139.  
  140. Thanks to:
  141.  
  142. Matt Dillon, Steve Drew, Calro Borreo and Cesare Dieni for the previous
  143. versions of Csh.
  144.  
  145. Ralph Babel, Eddy Carroll, Gary Duncan, Randell Jesup, Steve Koren, Tim
  146. MacKenzie, Axel Roebel, Mike Schwartz for their code contributions and
  147. suggestions.
  148.  
  149. Michael Beer, Carl Johan Block, Hubert Feyere, Magnus Heldestad, Carsten
  150. Heyl, Alex Liu, Declan McArdle, Svante Eriksson, Luke Mewburn, Peter Orbaek,
  151. Allard Siemelink, Roddi Walker, Shimon Weissman and the unknown Swedish guy
  152. who found the double-LF bug for their bug reports and feedback.
  153.  
  154. Roy Haverman, Martin Horneffer, Hans-Christian Huerlimann, Daniel Pfulg,
  155. Patrizio Rusconi, Christian Schneider and especially Markus Illenseer for
  156. the German translation of the doc.
  157.  
  158. Olivier Berger for the French translation of the doc.
  159.  
  160.  
  161. AMIGAGUIDE
  162. ----------
  163.  
  164.   AmigaGuide, AmigaGuide.info, amigaguide.library, WDisplay, WDisplay.info
  165.        (c) Copyright 1992 Commodore-Amiga, Inc.  All Rights Reserved.
  166.           Reproduced and distributed under license from Commodore.
  167.  
  168.        AMIGAGUIDE SOFTWARE IS PROVIDED "AS-IS" AND SUBJECT TO CHANGE;
  169.      NO WARRANTIES ARE MADE.  ALL USE IS AT YOUR OWN RISK.  NO LIABILITY
  170.                         OR RESPONSIBILITY IS ASSUMED.
  171.  
  172.  
  173. II. OVERVIEW
  174. ------------
  175.  
  176. Shell provides a convenient AmigaDos alternative command interface.  All its
  177. commands  are internal and thus it does not rely on the c:  commands for any
  178. functionality.
  179.  
  180. Major features include:
  181.     - freely programmable command line editing
  182.     - simple history
  183.     - piping
  184.     - aliases with arguments
  185.     - variables & variable handling (embedded variables)
  186.     - file name expansion via wild carding ('?', '*' and more)
  187.     - conditionals (if/else etc..)
  188.     - source files  (w/ gotos and labels)
  189.     - tab file name completion
  190.     - object oriented features (file classes, actions)
  191.     - many built in commands to speed things up
  192.     - full functionality on VT terminals
  193.  
  194. CShell runs on minimum stack, for recursive aliases and source files better
  195. increase stack to 10K or more.
  196.  
  197. If you use CShell for the first time, remember the following:
  198.     - CShell internal commands must be lowercase & can be abbreviated
  199.     - AmigaDOS command 'Execute' causes some trouble. You cannot
  200.       redirect it, you must not rename it, and you get no return code.
  201.       You can also use 'source' to start your scripts, but you'll have
  202.       to rewrite them a bit. Besides the '.key'-type commands, 'source'
  203.       is downward compatible with 'Execute'.
  204.     - You can always get more information on a command if csh.doc is
  205.       in the current directory or in csh: (you will be able to modify
  206.       this) and you enter 'man <command>'
  207.     - The wild card #? doesn't work. Use *
  208.        (#? only works if you "escape" it... better use * :-)
  209.  
  210.  
  211. III. RESTRICTIONS
  212. -----------------
  213.  
  214. The c:Execute command cannot be redirected, does not return error codes, and
  215. might cause other problems. It will not work at all if it has been renamed.
  216.  
  217. The  VDK: handler and Frank Seidel's BootRam-Handler have a bug with setting
  218. file  dates,  so  when  using  the copy command you should try the -d and -p
  219. switches, otherwise your file date will be bad. (This is not a shell bug)
  220.  
  221. If  using  it with conman you may consider starting shell with the -a switch
  222. to  turn  off  shell's  command line editing and use conmans instead. You'll
  223. lose, however, many shell features like file name completion.
  224.  
  225. CB-handler  (a tool that installs a scrollbar in the CLI window) is not 100%
  226. compatible  with  cshell.  The log will not always represent the real screen
  227. contents.
  228.  
  229. Don't  use  the  "Iconify" feature of KingCON (a CON-Handler replacement that
  230. gives  you  scrollbar  and  other  features in CLI windows). Don't ignore the
  231. warning,  KingCON  gives you when iconifying a Cshell window. This will crash
  232. your  system  because Iconify makes Cshell's internal window pointer invalid.
  233. Start Cshell with option "-a" or "-t" to use "Iconify" safely.
  234.  
  235.  
  236. IV. NOTES ON PIPES
  237. ------------------
  238.  
  239.     PIPES
  240.     PIPES  have  been implemented using temporary T:  files.  Thus, you
  241.     should be  careful  when  specifying  a 't:*' expansion as it might
  242.     include the temporary files. These files are deleted on completion
  243.     of the pipe segment.
  244.  
  245.     The file names used are completely unique, even with multiple shell
  246.     running simultaneously.
  247.  
  248.     My  favorite  new  feature is the fact that you can now redirect to
  249.     and  from,  and pipe internal commands.  'echo charlie >ram:x', for
  250.     instance.  Another favorite:
  251.  
  252.     echo "echo mem | csh" | csh
  253.  
  254.     No BCPL program should be output-append redirected (>>).
  255.  
  256.  
  257. V.  COMMAND PRE-PROCESSOR
  258. -------------------------
  259.  
  260.     PREPROCESSING
  261.     Preprocessing is done on the command line before it is passed on to
  262.     an internal or external routine:
  263.  
  264.     ^c    where c is a character is converted to that control
  265.         character. Thus, say '^l' for control-l.
  266.  
  267.     \233    insert character code 233 octal. Do not use values between
  268.         200o and 232o, as they have special meanings. \240 is the
  269.         word separator.
  270.  
  271.     $name    where name is a variable name. Variable names can consist
  272.         of 0-9, a-z, A-Z, and underscore (_).  The contents of the
  273.         specified variable is used.  If the shell variable doesn't
  274.         exist, csh tries to find a local or global (ENV:) variable
  275.         of the same name. If that fails, too, "$name" is inserted.
  276.         That is, if the variable 'i' contains 'charlie',
  277.         then '$i' -> 'charlie'.
  278.         If the variable 'i' doesn't exist, then '$i' -> '$i'.
  279.  
  280.     ;    delimits commands.   echo charlie ; echo ben.
  281.  
  282.     ' '    (a space). Spaces delimit arguments.
  283.  
  284.     "string" a quoted string. Trailing quotes are optional.
  285.         For instance, if you want to echo five spaces and an 'a':
  286.  
  287.         echo      a       -> a
  288.         echo "    a"      ->      a
  289.  
  290.         See also builtin variable "_cquote".
  291.  
  292.     \c    override the meaning of special characters.
  293.         '\^a' is a circumflex and an a rather than control-a.
  294.         To get a backslash, you must say '\\'.
  295.  
  296.         also used to overide alias searching for commands.
  297.  
  298.     >file    specify output redirection.  All output from the command is
  299.         placed in the specified file.
  300.  
  301.     >>file    specify append redirection
  302.         (Does not work with BCPL programs).
  303.  
  304.     <file    specify input redirection. The command takes input from the
  305.         file rather than the keyboard (note: not all commands
  306.         require input; it makes no sense to say 'echo <charlie'
  307.         since the 'echo' command only outputs its arguments).
  308.  
  309.     <>file    specify input AND output redirection. The file must be
  310.         either "NIL:" or an interactive stream (eg, a console
  311.         window: <>CON:////InOut).
  312.  
  313.     |    PIPE specifier.  The output from the command on the left
  314.         becomes the input to the command on the right.  The current
  315.         SHELL implementation uses temporary files to store the data.
  316.  
  317.     !!    execute the previously executed command.
  318.     !nn    (nn is a number).  Insert the history command numbered n
  319.         (see the HISTORY command)
  320.     !partial search backwards through the history list for a command
  321.         which looks the same as 'partial', and execute it.
  322.  
  323.     #    enter comment.  The rest of the line is discarded.
  324.         (note: \# will, of course, overide the comment character's
  325.                special meaning)
  326.  
  327.     {e hi;e ho} executes two commands as one, so they can be redirected
  328.         together (see ALIAS command). The trailing curly brace is
  329.         optional.
  330.  
  331.     $(foo)    insert the stdout of the command 'foo' at this position of
  332.         the command line. Every line of the output will count as one
  333.         argument. The closing parenthesis is optional.
  334.  
  335.     `foo`    insert the stdout of the command 'foo' at this position of
  336.         the command line. Every blank separated word will count as
  337.         one argument. Leading, trailing and multiple blanks will be
  338.         removed. The trailing backtick is optional.
  339.  
  340.     $nn    (nn is a number).  Cshell scripts only!
  341.         Insert argument number nn for $nn.  Thus, $1 becomes the
  342.         first argument, $2 the second, $3 the third and so on.
  343.         $0 is the name of the command (script).  If there's no
  344.         argument nn then $nn remains unchanged (unset variable).
  345.  
  346.     $#    Number of arguments.  Cshell scripts only!
  347.         For example: if $# is 3 then $3 will be the highest
  348.         meaningful variable for an argument.
  349.  
  350.     --    stop option parsing here. Works for internal commands only.
  351.         Example: rm -- -x will remove the file '-x'
  352.  
  353.     Please note the subtle differences between
  354.         alias count {echo one;echo two}
  355.         alias count "echo one;echo two
  356.     The first form will create an alias that contains a local alias. The
  357.     other will create a plain alias. Also, things within braces will not
  358.     be parsed more than once, therefore a backslash needs not be pre-
  359.     ceded by a pair of backslashes. Thus the commands look the same as
  360.     if they were to be typed in at the prompt. To echo lots of '#',
  361.     either use:
  362.         forever {echo \#
  363.         forever "echo \\\#
  364.     A block can spread over several lines. Refer to the SOURCE command.
  365.  
  366.  
  367. VI. COMMAND LINE EDITING
  368. ------------------------
  369.  
  370.     o The command line can be up to 255 chars.
  371.     o Inserts  and  deletes  are handled correctly over multiple lines.
  372.     o The script 'menu.sh' installs an intuition menu that contains most
  373.       editing functions
  374.  
  375.     EDITING
  376.  
  377.     -- MOVING --
  378.     Left Arrow      One character left
  379.     Right Arrow      One character right
  380.     Shift-Left Arrow  One word left
  381.     Shift-Right Arrow One word right
  382.     ESC-Left Arrow      Beginning of line (^A) (^Z)
  383.     ESC-Right Arrow      End of line       (^E)
  384.     -- DELETING --
  385.     Backspace      Previous character
  386.     Del          Character under cursor
  387.     ESC-Backspace      Previous word     (^W)
  388.     ESC-Del          Next word
  389.     ESC-x-Backspace      To start of line  (^B)
  390.     ESC-x-Del      To end of line    (^K)
  391.     ESC-d          Entire line       (^X)
  392.     -- HISTORY --
  393.     Up Arrow      Recall previous commands
  394.     Down Arrow      Recall commands
  395.     Shift-Up Arow      Get history from partial (or number)
  396.     Shift-Down Arrow  Go below last command of history
  397.     ESC-Up Arrow      Get start of history
  398.     ESC-Down Arrow      Get end of history
  399.     ESC-!          Get history from partial (or number)
  400.     ^T          Insert tail (all but first word) of previous line
  401.     ^P          Duplicate previous word (useful for mv)
  402.     -- COMPLETION --
  403.     TAB          Inserts first matching file name
  404.     Shift-TAB      Inserts longest common substring
  405.     ESC-TAB          Inserts all matching file names (also ESC-*)
  406.     ESC-c          Does a quick cd on left word (TAB for cycling)
  407.     ESC-~          Inserts the last current directory
  408.     ^D          Shows all files that match a pattern (also ESC-=)
  409.     ESC-p          Insert first/next matching program name
  410.     ESC-P          Shows all matching program names
  411.     -- EXECUTING LINE --
  412.     Return          Executes line
  413.     ESC-Return      Executes this line of history & brings up next one
  414.     ^N          Next line. Don't exec this one but store history
  415.     ^\          EOF (directly exits)
  416.     -- MISCELLANEOUS --
  417.     ^L          Retype current line.
  418.     ^O          Echo a ^O
  419.     ^R          Repeat last command (don't play with this)
  420.     ^U          Undo/Redo last edit
  421.     ^V          Quote next char
  422.     ESC-i          Toggle Insert/Overwrite
  423.     f1-f10          Execute command if variable exists.
  424.     F1-F10          More commands (Shifted f keys).
  425.     Help          Invokes help command
  426.  
  427. Whenever  the  cursor is placed on or directly after an incomplete file name
  428. and   you   press  TAB,  CShell  inserts  for  the  first  filename  (sorted
  429. alphabetically) that matches the name part already typed.  Any wildcards are
  430. allowed  here, if none are given, '*' is appended.  Immediately pressing TAB
  431. again  brings  up  the next file name that matched the substring.  Shift-TAB
  432. will  only  insert  the  as much as is common to all files that matched your
  433. abbreviation.  If pressed again, behaves just like TAB.  ESC-Tab inserts the
  434. name  of the directory where you would have ended up with a quick cd to that
  435. substring.
  436.  
  437. Note that ^D now means 'quit batchfile' like under AmigaDOS and is no longer
  438. used for quitting CShell.  If you want it back, enter 'keymap 0 4=41'
  439.  
  440. The  CTRL  keys  FGVY  are unset, feel free to map them to any function (see
  441. chapter XV).  You can also remap all preset keys.
  442.  
  443. VII. FUNCTION KEYS
  444. ------------------
  445.  
  446.     FUNKEY
  447.     Function keys now insert text to the current position on the command
  448.     line. They may be terminated with a ^M (return). f1 would be non-
  449.     shifted where as F1 is shifted.
  450.     Most of functions key have a default definition, but it may be
  451.     changed.
  452.  
  453.         $ set f1 dir df0:^M
  454.  
  455.     will add the text 'dir df0:<return>' to the current line.
  456.  
  457.         $ set f1 dir
  458.  
  459.     would only add 'dir' you could then enter ' df0:<return>'
  460.  
  461.  
  462. VIII. SHELL COMMANDS
  463. --------------------
  464.  
  465.     STARTUP OPTIONS
  466.     First to start shell from a CLI:
  467.  
  468.     csh [-abcCfiknstv] [-c command;command]
  469.     csh [-abcCfiknstv] [batchfile1 ... batchfileN]
  470.  
  471.      -a  AUX: mode. No command line editing and text highlighting
  472.           (window opening is not forced and AUTO-windows don't lose
  473.            the ability to be closed)
  474.      -b  starts shell in background, which means only task priority -1.
  475.      -c  allows execution of one command line and then exits out
  476.          of  shell.   This  is  useful for running an internal shell
  477.          commands in the background or from an external application:
  478.         run csh -c "dir df0:; copy -r df0: df1: >nil:; echo Done"
  479.      -C  same as -c, but the command line is not parsed twice. This
  480.          allows passing of file names with blanks within.
  481.         run csh -C rm "Ram Disk:tempfile"
  482.      -f  starts shell in foreground, which means only task priority 1.
  483.          you might reset this prioritiy to 0 at the end of your .login
  484.      -k  sets _nobreak before doing anything
  485.      -L  suppresses starting of s:.logout
  486.      -m  sets _nomatch  (which is unset by default)
  487.      -M  don't clear menus (especially for KingCON),
  488.          by default CSH clears menus of its window
  489.      -n  suppresses starting of s:.login
  490.      -N  suppresses starting of s:.cshrc
  491.      -s  globally enables the asterisk * as alias for #? in AmigaDOS 2.0
  492.          This means you can use * inside file requesters as well.
  493.          (obsolete option -- * is default -- #? is still allowed !!)
  494.      -t  terminal mode. You can use command line editing and text high-
  495.          lighting on a VT100 compatible terminal. To swap backspace
  496.          and DEL, refer to the 'keymap' command
  497.           (window opening is not forced and AUTO-windows don't lose
  498.            the ability to be closed)
  499.      -v  sets _verbose to 'hs' before doing anything.
  500.      -V  send only VT100 compatible control sequences
  501.           (no special Amiga control sequences)
  502.      -w  don't fetch pointer of window Cshell is running in,
  503.           eg, for running Cshell remote or with KingCON (iconify)
  504.           (menus, titlebar and some window related commands disabled)
  505.  
  506.     COMMAND EXECUTION
  507.  
  508.     Internal shell commands are case sensitive and may be abbreviated.
  509.     Also commands buffered with "rehash" may be abbreviated. This can
  510.     be toggled with the variable "_abbrev".
  511.  
  512.    The first argument is the command-name... here is (in order) how Shell
  513.    tries to execute it:
  514.  
  515.     1)  The alias list is searched for an alias with an exactly
  516.         matching name.
  517.     2)  Internal commands list is scanned for a command even partially
  518.         matching name (so you can, for instance, say resi for resident;
  519.         however, you should specify enough of a command to be unique).
  520.     3)  Then, the list of functions is scanned for a command that
  521.         matches completely. If one is found, the result of the function
  522.         is echoed to stdout.
  523.     4)  Now the command is assumed to be external.
  524.         Arguments with blanks, semicolons or empty strings will be
  525.         surrounded by quotes.
  526.     5)  If the file is a directory, a 'cd <file>' will be performed to
  527.         it.
  528.     6)  AmigaDOS resident list are scanned for it (you can use Shell's
  529.         'resident' command to add/remove a file in the DOS list).
  530.     7)  If the file is in the current directory and it's executable, it
  531.         is started.
  532.     8)  Then it is searched in the AmigaDOS path and c:
  533.     9)  Now, the shell path ($_path) is searched. If it's found and
  534.         executable, it's started. If it has the 's' bit set, it will
  535.         be executed using the appropriate shell. See FOREIGN SHELLS
  536.     10) If there exists a file with the suffix '.sh' and the same root
  537.         in the current directory or in the shell path, it is 'source'd.
  538.     11) Then the variable _rxpath is examined. If there exists a file
  539.         with the suffix '.rexx' and the same root in the current direc-
  540.         tory or in '$_rxpath', 'RX <file>' will be performed.
  541.     12) If all failed, an 'exec' action is sent to the file. See chapter
  542.         XIV for more info on classes and actions.
  543.  
  544.     To enforce that the external 'dir'-command is used, enter 'Dir'. It
  545.     is a good habit to uppercase the first letter of all external com-
  546.     mands, even if this is not necessary.
  547.  
  548.     AUTOMATIC SOURCING may be accomplished by naming shell scripts with
  549.     a .sh suffix.  Thus, if you say 'stuff' and the file 'stuff.sh'
  550.     exists in your current or anywhere in Shell search path (NOTE:
  551.     won't be found in the AmigaDOS path), it will be SOURCED with all
  552.     arguments you have given placed in the $_passed variable.  This is
  553.     equivalent to typing 'source stuff.sh'
  554.  
  555.     FOREIGN SHELLS are supported through key characters at the beginning
  556.     of their scripts.  If a file in the command search path has the s-bit
  557.     set, the first few bytes are read. If the first two are either '#!'
  558.     or ';!', the rest of the first line will be interpreted as the name
  559.     of the shell that is supposed to execute the script.
  560.     If they are '/*', the command 'RX' is used, if none of the above,
  561.     'c:Execute'. Example:
  562.       #!SKsh -c source
  563.  
  564.     WILDCARDS
  565.     Most shell commands will accept multiple arguments that can
  566.     be as a result of wild card expansion.  Also when calling
  567.     an external command shell will first expand any wild cards
  568.     to separate arguments.  If you wish to have the external command
  569.     handle it's own wild carding you will need to insert quotes
  570.     around the special wild card characters or use an alias (see
  571.     explanation of 'alias')
  572.  
  573.     eg.
  574.         arc a new.arc *.txt    - shell will expand and pass to arc
  575.         arc a new.arc "*.txt"    - let arc expand the wild cards.
  576.         alias arc "*a Arc $a"    - now shell will never expand
  577.  
  578.     The patterns are fairly extensive, and approximate some of the
  579.     ability of Unix/grep "regular expression" patterns.  Here are the
  580.     available tokens:
  581.  
  582.     ?    Matches a single character.
  583.     #    Matches the following expression 0 or more times.
  584.     (ab|cd)    Matches any one of the items seperated by '|'.
  585.     ~    Negates the following expression.  It matches all strings
  586.         that do not match the expression (aka ~(foo) matches all
  587.         strings that are not exactly "foo").
  588.     [abc]    Character class: matches any of the characters in the class.
  589.     [~bc]    Character class: matches any of the characters not in the
  590.         class.
  591.     a-z    Character range (only within character classes).
  592.     %    Matches 0 characters always (useful in "(foo|bar|%)").
  593.     *    Synonym for "#?", not available by default in 2.0. Available
  594.         as an option that can be turned on.
  595.  
  596.     "Expression" in the above table means either a single character
  597.     (ex: "#?"), or an alternation (ex: "#(ab|cd|ef)"), or a character
  598.     class (ex: "#[a-zA-Z]").
  599.  
  600.     Additional wildcards allowed:
  601.  
  602.     .../*    recursive search down ALL sub directories from current level
  603.     !    synonym for ~, supported for compatibility
  604.     &    prefixed to patterns, ask confirmation for each file
  605.     ~    the previous current directory (if separated)
  606.     Note that a pattern must contain a '?' or a '*', otherwise the other
  607.     special characters are not recognized. Furthermore, you cannot spe-
  608.     cify a single '?' as a pattern in the first argument to a command,
  609.     as this will be passed on to the command in order to show its usage.
  610.  
  611.     If pattern.library is present it LIBS:, it will be used for the
  612.     matching. (disabled, now Cshell always uses dos.library)
  613.  
  614.     Examples:
  615.  
  616.     df0:.../*    all files in all directories on df0:
  617.     df0:.../!*.info    full directory tree of df0: but exclude
  618.             any ugly .info files.
  619.     !*.o !*.c    will result in ALL files matching since what
  620.             doesn't match the !*.o will match the !*.c
  621.     df1:&*        all files in root of df1:, but ask
  622.             confirmation for each
  623.     *.[co]        all files ending in .c or .o
  624.     ~*.[co]        all files NOT ending in .c nor in .o
  625.     ~        the previous current directory
  626.     ~/*.c        all .c files in the previous current directory
  627.     ~//        the parent of the previous current directory
  628.     .        the current directory
  629.     ./foo.c        the same as foo.c
  630.     ..        the parent of the current directory
  631.     ../foo.c    the file foo.c in the parent directory
  632.  
  633.     Note that some commands prevent wild card expansion. These are:
  634.       - dir, rpn, whereis, window
  635.     Those commands will expand the wild cards themselves. This is why
  636.       dir @without( *.? , *.o )
  637.     will not work. Instead use:
  638.       set arg @without( *.? , *.o );dir $arg
  639.  
  640.     There is one exception to the rules given above: A single '?' as
  641.     the first argument will *not* expand in order to allow you to get
  642.     the usage of CLI and csh commands easily.
  643.  
  644.     Due to implementation limitations, patterns are only recognized
  645.     if they contain *, ?, [ or ]. To let Cshell expand patterns which
  646.     does not contain one of these chars just append "[]" to the
  647.     pattern (this will NOT change the meaning of the pattern!)
  648.  
  649.  
  650. LIST OF COMMANDS:
  651. -----------------
  652.  
  653.     ABORTLINE
  654.  
  655.     Usage    : abortline
  656.     Example    : echo a;abort;echo b
  657.     Results    : a
  658.  
  659.     Causes the rest of the line to be aborted. Intended for use in
  660.     conjunction with exception handling.
  661.  
  662.     ACTION
  663.  
  664.     Usage    : action [-a] actionname file [arguments]
  665.     Example : action extr csh515.lzh csh.doc
  666.  
  667.     Sends an action to a file. See chapter XIV CLASSES
  668.  
  669.     Options:
  670.      -a (abort) returns 0 if failed and 1 if successful. Otherwise,
  671.                 normal error codes (10 or 11) are returned
  672.  
  673.     ADDBUFFERS
  674.  
  675.     Usage    : addbuffers drive
  676.           addbuffers drive buffers [drive buffers ...]
  677.     Example    : addbuffers df0: 24
  678.  
  679.     Just like AmigaDOS addbuffers command, causes new buffers to be
  680.     allocated for disk I/O.  Each buffer costs 512 bytes of memory,
  681.     CHIP memory if a disk drive. Buffers may be negative (to remove
  682.     buffers from a drive).
  683.  
  684.     To show actual amount of buffers use "addbuffers drive"
  685.     or "addbuffers drive 0".
  686.  
  687.     ADDPART (or TACKON)
  688.  
  689.     Equivalent to TACKON.
  690.  
  691.     ALIAS
  692.  
  693.     Usage    : alias [name [command string] ]
  694.     Example    : alias vt "echo Starting VT100;run sys:tools/vt100"
  695.  
  696.     Sets a name to be a string. You can alias a single name to a set
  697.     of commands if you enclose them in quotes as above. By simply
  698.     typing vt, the command line above would be executed.
  699.     Aliases may call each other, but direct recursion is prohibited,
  700.     so the following works: alias ls "ls -s"
  701.     To prevent alias replacement, enter: \ls
  702.  
  703.     By typing "alias name", you will get the alias for that name, while
  704.     with "alias" you get a list of all alias.
  705.  
  706.     ARGUMENT PASSING TO AN ALIAS:
  707.  
  708.     Usage    : alias name "%var[%var...] [ command_string ]"
  709.           alias name "*var[%var...] [ command_string ]"
  710.     Example    : alias xx "%q%w echo hi $q, you look $w
  711.           xx Steve great today
  712.     Results    : hi Steve, you look great today
  713.  
  714.     The second form of the alias command allows passing of arguments
  715.     to any position within the command string via use of a variable
  716.     name. To pass arguments to the end of a command string this method
  717.     is actually not necessary. These variables are local, so they don't
  718.     destroy another variable with the same name.
  719.     If you specify multiple arguments, every argument will be assigned
  720.     one word, and the last argument will be assigned the rest of the
  721.     command line.
  722.  
  723.     Using a '*' instead of the first '%' prevents wild card expansion:
  724.         alias zoo "*a zoo $a
  725.     To expand the wild cards after you got them, use
  726.         exec set a $a
  727.  
  728.     IMPLICIT ALIASES:
  729.  
  730.     Usage    : {command;command}
  731.           {%var command;command} arg arg
  732.     Example    : {%tmp echo $tmp $tmp} hello    --> hello hello
  733.  
  734.     Curly braces define temporary aliases. They can be redirected as
  735.     a whole, can have arguments and local variables. They count as
  736.     one argument, even if there are blanks inside (as with quotes), and
  737.     they may be nested. Complex alias definitions can use the braces
  738.     instead of quotes, although this will add some calling overhead.
  739.     The closing curly brace is optional if at the end of line.
  740.     Example:
  741.  
  742.     alias assert {e "Are you sure? ";input -s sure
  743.  
  744.     ASCII
  745.  
  746.     Usage    : ascii [-ho]
  747.           ascii [-ho] string
  748.  
  749.     If called without arguments, ascii outputs a complete ASCII table.
  750.     Given a string, shows each character in ASCII.
  751.  
  752.     Options:
  753.      -h shows numbers in hexadecimal
  754.      -o shows numbers in octal
  755.  
  756.     ASSIGN
  757.  
  758.     Usage    : assign
  759.           assign logical
  760.           assign [-adlnp] logical1 physical1 [log2 phy2 ... ]
  761.  
  762.     The first form shows all assigns.
  763.     The second form kills one assign.
  764.     The third form assigns logical1 to physical1 and so on.
  765.  
  766.     Options:
  767.      -a adds a new path to an existing assign
  768.      -d creates a deferred (late-binding) assign
  769.          (identical with old option -l)
  770.      -p creates a path (non-binding) assign
  771.          (identical with old option -n)
  772.  
  773.     For definition of add/defer/path, refer to your AmigaDOS manual.
  774.  
  775.     BASENAME
  776.  
  777.     Usage    : basename var path [path ...]
  778.     Example    : basename x df0:c/Dir    # sets x to "Dir"
  779.  
  780.     Sets var specified to basenames of paths.
  781.  
  782.     CAT (or TYPE)
  783.  
  784.     Usage    : cat [-n] [file file....]
  785.     Example    : cat foo.txt
  786.  
  787.     Type the specified files onto the screen.  If no file is specified,
  788.     STDIN in used (note: ^\ is EOF).  CAT is meant to output text files
  789.     only. 
  790.  
  791.     Options:
  792.       -n  output numbered lines.
  793.  
  794.     CD
  795.  
  796.     Usage    : cd [path]
  797.           cd -g device1 [device2 [device3 ...]]
  798.  
  799.  
  800.     Options:
  801.      -g generate a list of all directories on the given devices.
  802.  
  803.     Change your current working directory.  You may specify '..' to go
  804.     back one directory (this is a CD specific feature, and does not
  805.     work with normal path specifications).
  806.  
  807.     In most cases, you won't have to use the CD command. Just type
  808.     the desired directory at the prompt (very handy in conjunction with
  809.     file name completion). Typing a ~ alone on a command line cd's
  810.     to previous current directory.
  811.  
  812.     There are two situations left when you still need it:
  813.  
  814.     Entering 'cd *tem' will cd to the first name matched.
  815.  
  816.     The second form generates a list (an ASCII file) of all direc-
  817.     tories on the given devices. It will be stored in the file given
  818.     in $_qcd (default: 'csh:csh-qcd'). Note that this ASCII file will
  819.     not be merged but overwritten. Once you have generated this file,
  820.     you can cd to any directory on your harddisk(s) even if it's not
  821.     in the current directory.
  822.     If you have two directories of the same name and you use one of
  823.     them more, move the more important one to the beginning of the
  824.     qcd file. You might also sort the file.
  825.     It is legal to type just an abbreviation of the directory name
  826.     you want to cd to. No asterisk '*' necessary. If you end up in
  827.     the wrong directory, cd to the same directory again (best done
  828.     by Cursor-Up + RETURN). You will cycle through all directories
  829.     that matched the given abbreviation. The other possibility is to
  830.     specify the full name of the parent directory: cd devs/keym
  831.     You may also add devices and assigns, so if 'PageStream:' is one
  832.     line in the qcd-file, a cd to 'page' is successful.
  833.  
  834.     CD without any arguments displays the path of the directory you
  835.     are currently in.
  836.  
  837.     CHGRP
  838.  
  839.     Usage    : chgrp group file1 ... filen
  840.     Example    : chgrp 42 myfile
  841.  
  842.     Set group-id (0-65535) or group-name of specified files.
  843.     (currently, name-to-id mapping is not implemented)
  844.  
  845.     CHMOD
  846.  
  847.     Usage    : chmod [u|g|o|a][+|-|=][flags] file1 ... filen
  848.     Example    : chmod u+rwe myfile
  849.  
  850.     Set AmigaDOS file protection flags for the file specified.
  851.     Valid flags are h, s, p, a, r, w, e, d.  (x is the same as e)
  852.  
  853.     Ownership:
  854.       u  Set specified bits for User (aka Owner)
  855.       g  Set specified bits for Group
  856.       o  Set specified bits for Other (not User, not Group)
  857.       a  all, alias for "ugo" (User/Group/Other)
  858.     Specifying no ownership is equal to 'u'.
  859.  
  860.     Modes:
  861.       +  Set specified bits, leave all others
  862.       -  Clear specified bits, leave all others
  863.       =  Set specified bits, clear all others
  864.     Specifying no mode is equal to '='.
  865.  
  866.     Archive bit cleared by default!
  867.  
  868.     Note: This command is equivalent to "protect" except that the
  869.           arguments for filename(s) and flag(s) are reversed.
  870.  
  871.     CHOWN
  872.  
  873.     Usage    : chown owner file1 ... filen
  874.     Example    : chown 42 myfile
  875.  
  876.     Set owner-id (0-65535) or owner-name of specified files.
  877.     (currently, name-to-id mapping is not implemented)
  878.  
  879.     CLASS
  880.  
  881.     Usage    : [-n] name {type=param} [ "actions" {action=command} ]
  882.     Example : class zoo offs=20,dca7c4fd ext=.zoo actions view="zoo l"
  883.  
  884.     Defines a new class of files and the actions to be taken on them
  885.     in various cases, or shows old definitions if given no arguments.
  886.     See section XIV: OBJECTS
  887.  
  888.     Options:
  889.       -n (new)  forgets old definitions
  890.  
  891.  
  892.     CLOSE
  893.  
  894.     Usage    : close [filenumber]
  895.  
  896.     Close the specified file opened by open. Without filenumber, closes
  897.     all open files. See open and flist for more info.
  898.  
  899.     CLS
  900.  
  901.     Usage    : cls
  902.  
  903.     This is an alias. It only clears the screen, but also works on a
  904.     terminal (echo ^L doesn't).
  905.  
  906.     COPY (or CP)
  907.  
  908.     Usage    : copy [-udfpmo]  file file
  909.     or    : copy [-udfpmo]  file1 file2...fileN dir
  910.     or    : copy [-rudfpo] dir1...dirN file1...fileN dir
  911.  
  912.     Options    :
  913.      -r recursive, copy all subdirectories as well.
  914.      -u update, if newer version exists on dest, don't copy
  915.      -f freshen, if file doesn't exist on dest or newer, don't copy
  916.      -q suppresses 'not newer' and 'not there' messages in -u and -f
  917.      -d don't set destination file date to that of source.
  918.      -p don't set destination protection bits to those of source.
  919.      -m erases the original. does not work with -r
  920.      -o overwrites write/delete-protected, reads read-protected
  921.      -a don't clear archive bit
  922.  
  923.     Example    : copy -r df0: df1:
  924.  
  925.     Copy files or directories. When copying directories, the -r option
  926.     must be specified to copy subdirectories as well.  Otherwise, only
  927.     top level files in the source directory are copied.
  928.  
  929.     All files will be displayed as they are copied and directory's
  930.     displayed as they are created. This output can be suppressed by
  931.     redirecting to nil: eg. copy -r >nil: df0: df1:
  932.  
  933.     Copy will abort after current file on Control-C.
  934.  
  935.     Copy by default sets the date of the destination file to that of
  936.     the source file. To overide this feature use the -d switch.
  937.  
  938.     Similarly, it sets protection bits (flags) to those of source and
  939.     any file comment will be copied. To avoid this use -p. The archive
  940.     bit is always cleared by default (use option -a to leave it
  941.     untouched).
  942.  
  943.     Another useful option is the -u (update) mode where copy will not
  944.     copy any files which exists already in the destination directory
  945.     if the destination file is newer or equal to the source file.
  946.     This is useful when developing code say in ram: eg. 'copy *.c ram:'
  947.     when done you can copy -u ram: df1: and only those modules you have
  948.     modified will be copied back.
  949.  
  950.     Copy command will now create the destination directory if it does
  951.     not exist when specified as 'copy [-r] dir dir'. If you specify
  952.     copy file file file dir, then 'dir' must already exist.
  953.  
  954.     CP (or COPY)
  955.  
  956.     Equivalent to COPY.
  957.  
  958.     DATE
  959.  
  960.     Usage    : date [-bsr] [new date and/or time]
  961.     Example    : date Wednesday  # this refers to NEXT wed, of course
  962.  
  963.     Options:
  964.       -b print date/time from the battery clock, if existent
  965.       -s stores the current time internally
  966.       -r shows time relative to last stored in secs and hundredths
  967.  
  968.     Used to read or set system date and/or time. All standard options
  969.     may be used (yesterday, tomorrow, monday, etc.).
  970.     Leading zero's are not necessary.
  971.     Without parameters shows Dddddd DD-MMM-YY HH:MM:SS.
  972.  
  973.     DEC
  974.  
  975.     Usage    : dec varname [value]
  976.     Example    : dec abc
  977.  
  978.     Decrement the numerical equivalent of the variable with specified
  979.     value (default: 1) and place the ASCII-string result back into
  980.     that variable.
  981.  
  982.     DELETE (or RM)
  983.  
  984.     Usage    : delete [-fpqrv] file file file...
  985.     Example    : delete foo.txt test.c
  986.  
  987.     Remove (delete) the specified files.  Remove always returns
  988.     errorcode 0.  You can remove empty directories.  
  989.  
  990.     Options:
  991.      -r recursively remove non-empty directories.
  992.      -p (or f); remove delete-protected files.
  993.      -v toggle verbose output.  Useful if 'delete' is aliased.
  994.      -q (quit), delete aborts if the file to be removed didn't exist
  995.          or couldn't be deleted. This does _not_ affect non-matching
  996.          wildcards.
  997.  
  998.     If you specify any wildcard deletes the files will be listed as
  999.     they are deleted. This can be suppressed by redirecting to nil:
  1000.  
  1001.     DIR (or LS)
  1002.  
  1003.     Usage    : dir [-abcdfhiklnoqstuv] [-z [lformat]] [path path ... ]
  1004.     Example    : dir -ts downloads:
  1005.           dir -lz "%7s %-.16n %m" *.c
  1006.     Options:
  1007.      -d list directories only
  1008.      -f list files only
  1009.      -h list only files which not start with a dot, end with '.info' or
  1010.         have the h-flag set. Adds an 'i' bit to the flags which tells
  1011.         if an according .info file exists.
  1012.      -s short multi(4) column display.
  1013.      -c don't change colors for directories
  1014.      -q quiet display. does not show length in blocks
  1015.      -o display file nOtes
  1016.      -n display names only
  1017.      -p display full path names and suppress directory titles
  1018.      -a shows the age of all files in the format  days hours:minutes
  1019.      -i identifies every file, shows the type instead of the date.
  1020.         See chapter XIV CLASSES
  1021.      -v (viewdir) recursively sums up lengths of the files in a dir
  1022.      -l sorts the files by their length, longest first.
  1023.      -t sorts the files by their time, most recent first.
  1024.      -k sorts the files by their class (klass)
  1025.      -b sorts the files backwards.
  1026.      -g prints directories at the beGinning
  1027.      -e prints directories at the End
  1028.      -u must be given exactly two directories. Shows files only in
  1029.         the first directory, files in both and files in the second.
  1030.      -z custom format
  1031.         (must be followed by an argument which holds the format string)
  1032.  
  1033.     Displays a directory of specified files. Default output shows
  1034.     date, protection, block size, byte size and total space used.
  1035.     Protections flags include new 1.2/1.3 flags (see under protect),
  1036.     plus a 'c' flag which indicates that this file has a comment.
  1037.     Files are alphabetically sorted, without case sensitivity, and
  1038.     directories are in red pen (unless you use -c). Dir takes in
  1039.     account the width of your window.
  1040.  
  1041.     To recursively show the contents of a directory and all its
  1042.     sub-directories use the special wildcard pattern ".../*", see
  1043.     section "WILDCARDS" (man wildcards).
  1044.  
  1045.     The lformat string (option -z) is used to create your own directory
  1046.     format. Instead of the "-z lformat" command line argument you can
  1047.     set the variable "_dirformat" (which holds "lformat", but you must
  1048.     set option -z anyhow).
  1049.     Your custom format may contain the following codes:
  1050.      %a age               %l LF if comment      %t time
  1051.      %b size in blocks    %m multi column       %u size in K
  1052.      %c flag c (comment)  %n name               %v dir size in eng.
  1053.      %d date              %o filenote (comment) %w dir size in K
  1054.      %e flag i (.info)    %p name w/ path       %x translated date
  1055.      %f flags "hsparwed"  %q name w/ slash      %+ flag i as '+' or ' '
  1056.      %i flag d (dIr)      %r size in eng.
  1057.      %k class             %s size
  1058.  
  1059.      %I link information (S: softlink, H: hardlink, P: pipe, -: else)
  1060.      %L name of original file if link (empty otherwise)
  1061.      %N name + original name (of link)
  1062.      %F protection bits (flags "rwed") for group/other
  1063.      %U user-id
  1064.      %G group-id
  1065.  
  1066.     Between the '%' and the identifying letter, there may be an optional
  1067.     field width. If the number is preceded by a '-', the field contents
  1068.     will be left adjusted. If by a dot, the contents will be cut down
  1069.     to match the field width if they are longer.
  1070.     If the format string contains a %m, cshell will try to print more
  1071.     than one entry on one line. The column width is the field width of
  1072.     the %m entry. If omitted, it's assumed to be the one of the first
  1073.     file. If a file is longer, it will use two columns.
  1074.  
  1075.     If you prefer the old output-style of this command (5.19 and before)
  1076.     add the following line to your .cshrc file:
  1077.      set _dirformat "   %-24n %c%f %7s %4b %d %t"
  1078.  
  1079.     DISKCHANGE
  1080.  
  1081.     Usage    : diskchange drive...drive
  1082.  
  1083.     Like AmigaDOS diskchange.  Multiple drive names are allowed.
  1084.  
  1085.     ECHO
  1086.  
  1087.     Usage    : echo [-en] string
  1088.     Example    : echo hi there
  1089.     Results    : hi there
  1090.  
  1091.     Options:
  1092.      -n don't append newline.
  1093.      -e echo to stderr.
  1094.  
  1095.     Echo the given string.
  1096.  
  1097.     ELSE
  1098.  
  1099.     Usage    : else ; command
  1100.     Usage    : if -f foo.c ; else ; echo "Not there" ; endif
  1101.  
  1102.     Else clause, must follow an IF statement.
  1103.  
  1104.     ENDIF
  1105.  
  1106.     Usage    : endif
  1107.  
  1108.     The end of an if statement.
  1109.  
  1110.     Note: if you return from a script file with unterminated IF's
  1111.     and the last IF was false, prompt will be changed to an
  1112.     underscore ('_') and no commands will be executed until
  1113.     'endif' is typed.
  1114.  
  1115.     ERROR
  1116.  
  1117.     Usage    : error n
  1118.  
  1119.     Generates return code n.
  1120.  
  1121.     EXEC
  1122.  
  1123.     Usage    : exec [-i] command [args]
  1124.     Example    : set cmdline "dir ram:"
  1125.           exec $cmdline        # would not work without exec
  1126.  
  1127.     Options:
  1128.      -i  return code 0.
  1129.  
  1130.     Execute the command specified; exec command is equivalent to
  1131.     command, only you can use variables to specify command name.
  1132.     Note that the command line is parsed TWICE! Examples:
  1133.      set a dir ram:; exec $a              # right
  1134.      set a mkdir; exec $a "My directory"  # wrong! creates 2 directories
  1135.  
  1136.     Exec returns the return code of the command executed unless
  1137.     option -i (ignore) is set, in which case always 0 is returned.
  1138.  
  1139.     FAULT
  1140.  
  1141.     Usage    : fault error1 .. errorN
  1142.     Example    : fault 205 212
  1143.  
  1144.     Like AmigaDOS fault, prints specified error messages.
  1145.  
  1146.     FILENOTE
  1147.  
  1148.     Usage    : filenote file1 .. fileN  note
  1149.           filenote -s file1...fileN
  1150.  
  1151.     Options:
  1152.      -s (second form) ; displays the file notes of the given files.
  1153.  
  1154.     The first form sets AmigaDOS comment of the specified file.
  1155.  
  1156.     FLIST
  1157.  
  1158.     Usage    : flist
  1159.  
  1160.     Lists the filenumbers of files opened by open.
  1161.     See open and close for more info.
  1162.  
  1163.     FLTLOWER
  1164.  
  1165.     Usage    : fltlower
  1166.     Example    : dir | fltlower
  1167.     Or    : fltlower <readme
  1168.  
  1169.     This is a filter command, i.e. it reads from stdin and writes to
  1170.     stdout. The more natural way to use it is a pipe, or it can be
  1171.     redirected.
  1172.     Its purpose is to convert all alphabetic to lower case.
  1173.  
  1174.     FLTUPPER
  1175.  
  1176.     The same of fltlower, only this converts to upper case.
  1177.  
  1178.     FOREACH
  1179.  
  1180.     Usage    : foreach [-v] varname ( strings ) command
  1181.     Example    : foreach i ( a b c d ) "echo -n $i;echo \" ha\""
  1182.     Result    : a ha
  1183.           b ha
  1184.           c ha
  1185.           d ha
  1186.  
  1187.     Options:
  1188.      -v display arguments every time command is executed. 
  1189.  
  1190.     'strings' is broken up into arguments.  Each argument is placed in
  1191.     the local variable 'varname' in turn and 'command' executed. Put
  1192.     the command(s) in quotes.
  1193.  
  1194.     Foreach is especially useful when interpreting passed arguments in
  1195.     an alias.
  1196.  
  1197.     eg.
  1198.         foreach i ( *.pic ) viewilbm $i
  1199.     assuming a.pic and b.pic in current directory the following commands
  1200.     will occur:
  1201.         viewilbm a.pic
  1202.         viewilbm b.pic
  1203.  
  1204.     All 'for...' commands can be interrupted using CTRL-D or CTRL-E.
  1205.  
  1206.     FOREVER
  1207.  
  1208.     Usage    : forever command
  1209.     or    : forever "command;command;command..."
  1210.  
  1211.     The specified commands are executed over and over again forever.
  1212.  
  1213.     Execution stops if you hit ^C or ^D, or if the commands return with
  1214.     an error code.
  1215.  
  1216.     FORLINE
  1217.  
  1218.     Usage    : forline var filename command
  1219.     or    : forline var filename "command;command..."
  1220.     Example    : forline i RAM:temp "echo line $_linenum=$i"
  1221.  
  1222.     For each ASCII line of file specified commands are executed and
  1223.     var points to line content. You can check system variable _linenum
  1224.     to find the number of the line currently read.
  1225.     If STDIN (case sensitive) is specified as input file, the lines are
  1226.     read from standard input.
  1227.  
  1228.     FORNUM
  1229.  
  1230.     Usage    : fornum [-v] var n1 n2 command
  1231.     or    : fornum [-v] -s var n1 n2 step command
  1232.  
  1233.     Example    : fornum -v x 1 10 echo $x
  1234.     or    : fornum -s x 10 1 -1 echo $x # counts backwards
  1235.  
  1236.     Executes  command(s)  for  all numerical values of x between n1 and
  1237.     n2.   If  more  than  one  command  is  specified,  or  command  is
  1238.     redirected, include command(s) in quotes.
  1239.  
  1240.  
  1241.     Options:
  1242.      -v (verbose) causes printing of progressive numbers.
  1243.      -s specify a step; if negative, the count will be backwards.
  1244.  
  1245.     GETENV
  1246.  
  1247.     Usage    : getenv [shellvar] envvar
  1248.  
  1249.     Gets the value of an ENV: variable and stores it in the shell
  1250.     variable 'shellvar'. If shellvar is omitted, the value of the
  1251.     ENV: variable is printed to stdout.
  1252.     This command is obsolete since ENV: variables can be retrieved
  1253.     by writing $envvar anywhere on the command line.
  1254.  
  1255.     GOTO
  1256.  
  1257.     Usage    : goto label
  1258.     Example    :
  1259.           label start
  1260.             echo "At start"
  1261.             dir ram:
  1262.             goto start
  1263.  
  1264.     Goto  the specified label name.  You can only use this command from
  1265.     a  source  file.   Labels  may  be  forward or reverse from current
  1266.     position. It is legal to jump out of if's.
  1267.  
  1268.     HEAD
  1269.  
  1270.     Usage    : head [filename] [num]
  1271.     Example    : head readme 20
  1272.  
  1273.     Display first "num" lines of "filename".   If num is not specified,
  1274.     10 is assumed. If filename is not specified, standard input (stdin)
  1275.     is taken instead.
  1276.  
  1277.     HELP
  1278.  
  1279.     Usage    : help [-f]
  1280.     Example    : help
  1281.     Options    :
  1282.      -f list functions also
  1283.  
  1284.     Simply  displays  all  the  available  commands.   The commands are
  1285.     displayed in search-order.  That is, if you give a partial name the
  1286.     first  command  that  matches  that  name  in  this list is the one
  1287.     executed.   Generally,  you  should  specify enough of a command so
  1288.     that it is completely unique.
  1289.  
  1290.     HISTORY
  1291.  
  1292.     Usage    : history [-nr] [partial_string]
  1293.     Example    : history
  1294.  
  1295.     Options    :
  1296.      -n omits line numbering
  1297.      -r reads history from stdin
  1298.  
  1299.     Displays  the  enumerated  history  list.   The size of the list is
  1300.     controlled  by  the  _history  variable.   If you specify a partial
  1301.     string, only those entries matching that string are displayed.
  1302.  
  1303.     HOWMANY
  1304.  
  1305.     Usage    : howmany
  1306.  
  1307.     This  command  tells you how many instances of Shell are running in
  1308.     your system.
  1309.  
  1310.     HTYPE
  1311.  
  1312.     Usage    : htype [-r] [file1..fileN]
  1313.  
  1314.     Options:
  1315.      -r display all files in a directory.
  1316.  
  1317.     Displays the specified files in hex and ASCII, just like the system
  1318.     command 'Type file opt h'.  Especially suitable for binary files.
  1319.  
  1320.     If there are no filenames specified, standard input is used,
  1321.     so you can use htype as the destination for a pipe.
  1322.  
  1323.     IF
  1324.  
  1325.     Usage    : if [-n] argument conditional argument [then]
  1326.     or    : if [-n] argument
  1327.     or    : if [-n] -f file    or   -e file
  1328.     or    : if [-n] -d file/dir
  1329.     or    : if [-n] -m
  1330.     or    : if [-n] -t file file1 .. fileN
  1331.     or    : if [-n] -r rpnexpression
  1332.     or    : if [-n] -v varname
  1333.     or    : if [-n] -o char arg ... arg
  1334.  
  1335.     Options:
  1336.      -n (NOT) reverses the result.
  1337.      -d tests the type of the object specified: if it is a
  1338.         directory, then TRUE; if it is a file (or it doesn't exist)
  1339.         then FALSE.
  1340.      -f (or -e) checks for existance of the specified file.
  1341.      -m test if FAST memory is present.
  1342.      -o tests for option 'char' in the rest of the arguments.
  1343.      -r evaluates a given RPN expression (see under RPN for more info).
  1344.         If value on top of stack is 0, then FALSE, else TRUE.
  1345.      -t compare the date and time of the first file with all the others;
  1346.         if the first is younger than ALL the others, then FALSE,
  1347.         else TRUE. If a file doesn't exists, it is considered as
  1348.         being older.
  1349.      -v test if a given variable is defined.
  1350.  
  1351.  
  1352.     Makes the following instructions up to the next endif conditinal.
  1353.     The 'then' is optional. The if clause must be followed by a semi-
  1354.     colon if instructions follow on the same line.
  1355.  
  1356.     If a single argument is something to another argument.  Conditional
  1357.     clauses allowed:
  1358.  
  1359.     <, >, =, ! and combinations.  Thus != is not-equal, >= larger or
  1360.     equal, etc...
  1361.  
  1362.     If arguments are not numeric, they are compared as strings.
  1363.  
  1364.     Usually the argument is either a constant or a variable ($varname).
  1365.  
  1366.     The second form of IF is conditional on the existence of the
  1367.     argument.  If the argument is a "" string, then FALSE, else TRUE.
  1368.  
  1369.     The third form of IF used by -f switch checks for existance of
  1370.     the specified file. -e is the same as -f
  1371.  
  1372.     Option -m is used to test if FAST memory is present.
  1373.     Example (to be included in a login.sh file):
  1374.     if -m; resident -d lc1 lc2 blink; endif
  1375.  
  1376.     Using -t form compares the date and time of the first file with
  1377.     all the others; if the first is younger than ALL the others, then
  1378.     FALSE, else TRUE. If a file doesn't exists, it is considered as
  1379.     being older.
  1380.     This feature is especially useful for building makefiles without
  1381.     using any MAKE utility.
  1382.  
  1383.     Example:
  1384.     if -t test.o test.asm test.i ; asm -o test.o test.asm ; endif
  1385.  
  1386.  
  1387.     Option -o tests for option 'char' in the rest of the arguments.
  1388.  
  1389.     Example: if -o r -rp ram:comm1.c     will yield TRUE.
  1390.  
  1391.     When using 'IF' command interactively if you are entering commands
  1392.     following an 'IF' that was false, the prompt will be set to a
  1393.     underscore '_ ' to indicate all commands will be ignored until
  1394.     an 'ELSE' or 'ENDIF' command is seen.
  1395.  
  1396.     INC
  1397.  
  1398.     Usage    : inc varname [value]
  1399.     Example    : inc abc 5
  1400.  
  1401.     Increment the numerical equivalent of the variable with specified
  1402.     value (default: 1) and place the ASCII-string result back into
  1403.     that variable.
  1404.  
  1405.     INFO
  1406.  
  1407.     Usage    : info [-pt] [path1 path2 ... pathN]
  1408.  
  1409.     Options    :
  1410.      -p  only display drives with readable (present) disks
  1411.      -t  print disk/fs type and bytes used instead of block sizes
  1412.  
  1413.     If called without arguments, info gives you the drive information
  1414.     on all devices. If one or more paths are specified, only infor-
  1415.     mation on those drives will be displayed.
  1416.  
  1417.     Note: Cshell does (correct) rounding for all displayed values,
  1418.           Commodore's Info command does not. So values may slightly
  1419.           change.
  1420.  
  1421.     INPUT
  1422.  
  1423.     Usage    : input [-sr] var var ... var
  1424.     Example    : input abc
  1425.  
  1426.     Options    :
  1427.      -s the whole line is read in as one word, including spaces.
  1428.      -r puts the console to single character mode before reading,
  1429.         ie. does not wait for RETURN to be pressed). Use with care.
  1430.  
  1431.     Input from STDIN (or a redirection, or a pipe) to a variable.  The
  1432.     next input line is broken up in words (unless quoted) and placed in
  1433.     the variable. 
  1434.  
  1435.     JOIN
  1436.  
  1437.     Usage    : join [-r] file1..fileN destfile
  1438.     Example    : join part1 part2 part3 total
  1439.  
  1440.  
  1441.     Options    :
  1442.      -r overwrite any existent destfile.
  1443.  
  1444.     Joins (concatenates) the specified files to get destfile. Join
  1445.     will refuse to overwrite an existing destfile, unless the 
  1446.     'r' option is used. 
  1447.  
  1448.     KEYMAP
  1449.  
  1450.     Usage    : keymap [number {key=function}]
  1451.     Example    : keymap 0 1030=4 1032=12
  1452.  
  1453.     Defines one keymap for the csh command line editing. See chapter XV.
  1454.  
  1455.     LABEL
  1456.  
  1457.     Usage    : label name
  1458.  
  1459.     Create a program label right here. Used in source files, you can
  1460.     then GOTO a label.
  1461.  
  1462.     LINECNT
  1463.  
  1464.     Another filter. Counts the number of lines of its stdin and writes
  1465.     it to stdout.
  1466.  
  1467.     LN (or MAKELINK)
  1468.  
  1469.     Usage    : ln [-s] filename [linkname]
  1470.     Example    : ln stuff/data newname
  1471.  
  1472.     Options    :
  1473.      -s make soft link (default is hard link)
  1474.  
  1475.     ln creates an additional directory entry, called a link,  to
  1476.     a file or directory.  Any number of links can be assigned to
  1477.     a file.
  1478.  
  1479.     filename is the name of  the  original  file  or  directory.
  1480.     linkname  is  the  new  name  to  associate with the file or
  1481.     filename.  If linkname is omitted,  the  last  component  of
  1482.     filename is used as the name of the link.
  1483.  
  1484.     A hard link (the default) is a standard directory entry just
  1485.     like the one made when the file was created.  Hard links can
  1486.     only be made to existing files.  Hard links cannot  be  made
  1487.     across file systems (disk partitions, mounted file systems).
  1488.     To remove a file, all hard links  to  it  must  be  removed,
  1489.     including  the  name by which it was first created; removing
  1490.     the last hard link releases the inode  associated  with  the
  1491.     file.
  1492.  
  1493.     A symbolic link, made with  the  -s  option,  is  a  special
  1494.     directory entry that points to another named file.  Symbolic
  1495.     links can span file systems and point  to  directories.   In
  1496.     fact,  you  can create a symbolic link that points to a file
  1497.     that is currently absent from the file system; removing  the
  1498.     file that it points to does not affect or alter the symbolic
  1499.     link itself.
  1500.  
  1501.     NOTE: Symbolic links (also known as "soft links") are
  1502.           currently NOT SUPPORTED by AmigaOS.  DO NOT USE!
  1503.  
  1504.     LOCAL
  1505.  
  1506.     Usage: local [var...var]
  1507.  
  1508.     Creates one or more local variables. Those variables disappear
  1509.     at the end of their alias or source file, and cannot be accessed
  1510.     from inside other aliases or source files.
  1511.     With no arguments, shows all top level variables and their values.
  1512.  
  1513.     LS (or DIR)
  1514.  
  1515.     Equivalent to DIR.
  1516.  
  1517.     MAKELINK (or LN)
  1518.  
  1519.     Equivalent to LN.
  1520.  
  1521.     MAN
  1522.  
  1523.     Usage    : man command(s)
  1524.     Example    : man mkdir
  1525.  
  1526.     Get  info about a Shell command, or others keywords.  These include
  1527.     all  special  _variables, plus various keywords:  WILDCARDS, PIPES,
  1528.     EDITING, STARTUP and more.
  1529.     See special alias manlist to get a list of ALL keywords supported
  1530.     by man.
  1531.     You  must set _man to the paths of your .doc files:
  1532.        set _man dh1:docs/aliases.doc dh1:docs/csh.doc
  1533.  
  1534.     To create your own .doc files, precede all your keywords by four
  1535.     blanks. 'man' will then display lines until the first character
  1536.     of a line is alphanumeric or has four leading blanks.
  1537.  
  1538.     MD (or MKDIR)
  1539.  
  1540.     Equivalent to MKDIR.
  1541.  
  1542.     MEM
  1543.  
  1544.     Usage    : mem [-cfqsl]
  1545.  
  1546.     Options:
  1547.       -c shows the free chip mem only
  1548.       -f shows the free fast mem only
  1549.       -q outputs just a number without titles
  1550.       -s stores current free memory
  1551.       -r shows memory used relative to last stored
  1552.       -l flushes all unneeded memory
  1553.  
  1554.     MENU
  1555.  
  1556.     Usage    : menu [-mn] [ title item...item ]
  1557.     Example    : menu Shell   JrComm,,j   Rename,"rename ",r  quit
  1558.  
  1559.     Options:
  1560.      -n clear all existing menus.
  1561.      -m use monospaced font.
  1562.  
  1563.     Appends one pull down in the current console window. Up to 31
  1564.     menus with 63 items each (including title) can be installed.
  1565.  
  1566.     If the item is just a string, that string will be in the menu item.
  1567.     When you select it, it will be put into the prompt and executed.
  1568.  
  1569.     If there is a comma and after that comma a second string, this
  1570.     will be the command will be inserted at the prompt. This time you
  1571.     have to add the ^M yourself if you want the command to be executed.
  1572.  
  1573.     If there is a second comma, the letter after that comma will be
  1574.     the keyboard shortcut for that menu item. (This will be case
  1575.     sensitive some day, use lowercase).
  1576.  
  1577.     If for any reason your current menu is corrupt, just enter an
  1578.     empty 'menu' command.
  1579.  
  1580.     When the first menu is installed you can use option -m to choose
  1581.     a monospaced font (System Default Font) instead of the default
  1582.     Intuition Font (which may be a proportional font). This is useful
  1583.     for user-formatted menus (like in the example script "menu.sh").
  1584.  
  1585.     MKDIR (or MD)
  1586.  
  1587.     Usage    : mkdir [-p] name name name...
  1588.     Example    : mkdir df0:stuff
  1589.  
  1590.     Options:
  1591.      -p create all dirs in path if necessary.
  1592.  
  1593.     Create the specified directories.
  1594.     If "name" ends with trailing slash it will be stripped off.
  1595.  
  1596.     mkdir now supports the -p option.  mkdir -p followed by a full path
  1597.     name will create all directories necessary to make the path.  For
  1598.     example, suppose that the directory ram:foo exists and is empty.
  1599.     "mkdir -p ram:foo/bar/tst/a" would create ram:foo/bar,
  1600.     ram:foo/bar/tst, and ram:foo/bar/tst/a all in one step.
  1601.     In addition, it will issue no error codes for directories it cannot
  1602.     make.
  1603.  
  1604.     MV (or RENAME)
  1605.  
  1606.     Equivalent to RENAME.
  1607.  
  1608.     OPEN
  1609.  
  1610.     Usage    : open filename filemode filenumber
  1611.     Example    : open RAM:data w 1
  1612.  
  1613.     This  allows you to open a file, redirect to it as many commands as
  1614.     you like, then close it.
  1615.     Filename is any valid AmigaDOS filename, filemode is either "r" for
  1616.     read or "w" for write, filenumber is a number between 1 and 10.
  1617.     To  redirect  a  program to or from an open file, use as your redir
  1618.     filename a dot followed by the filenumber.
  1619.     Here is a complete example:
  1620.  
  1621.         open RAM:data w 1
  1622.         echo -n 2+2= >.1
  1623.         rpn 2 2 + . CR >.1
  1624.         close 1
  1625.         type RAM:data    # will display 2+2=4
  1626.  
  1627.     See also close, flist.
  1628.  
  1629.     PATH
  1630.  
  1631.     Usage    : path [-gr] [dir...dir]
  1632.  
  1633.     Without arguments, lists AmigaDOS path. Otherwise adds given
  1634.     directories to the path, preventing duplicate entries.
  1635.  
  1636.     Options:
  1637.      -r Resets the path
  1638.      -g Global path modifications; operations (add, reset) apply to all
  1639.          CLI processes instead of only the current one
  1640.  
  1641.     Note:
  1642.     It's not perfectly "legal" to modify the path-list of other
  1643.     processes. Adding entries (option -g) works fine in most cases.
  1644.     But the removal of entries (options -gr together) may crash the
  1645.     system, because CSH doesn't know about the memory handling of
  1646.     other processes (it doesn't know how they allocated the memory
  1647.     for the path-list entries).
  1648.  
  1649.     So use option -g always with care (at least together with -r).
  1650.     If it works, it's okay. If not, you lose ;-)  There's no 100%
  1651.     reliable way for global path modifications.
  1652.  
  1653.     PRI
  1654.  
  1655.     Usage    : pri clinumber pri
  1656.     Example    : pri 3 5    # set priority of cli #3 to 5
  1657.  
  1658.     Change the priority of the specified task (use PS command to
  1659.     determine clinumber). If you specify 0 as clinumber you can
  1660.     change priority of "this" task (the one executing shell).
  1661.  
  1662.     PROTECT
  1663.  
  1664.     Usage    : protect file1 ... filen [u|g|o|a][+|-|=][flags]
  1665.     Example    : protect myfile u+rwe
  1666.  
  1667.     Set AmigaDOS file protection flags for the file specified.
  1668.     Valid flags are h, s, p, a, r, w, e, d.  (x is the same as e)
  1669.  
  1670.     Ownership:
  1671.       u  Set specified bits for User
  1672.       g  Set specified bits for Group
  1673.       o  Set specified bits for Other (not User, not Group)
  1674.       a  all, alias for "ugo" (User/Group/Other)
  1675.     Specifying no ownership is equal to 'u'.
  1676.  
  1677.     Modes:
  1678.       +  Set specified bits, leave all others
  1679.       -  Clear specified bits, leave all others
  1680.       =  Set specified bits, clear all others
  1681.     Specifying no mode is equal to '='.
  1682.  
  1683.     Archive bit cleared by default!
  1684.  
  1685.     Note: This command is equivalent to "chmod" except that the
  1686.           arguments for filename(s) and flag(s) are reversed.
  1687.  
  1688.     PS
  1689.  
  1690.     Usage    : ps [-les] [commandname...commandname]
  1691.  
  1692.     Options:
  1693.      -l shows full pathnames of commands
  1694.      -e excludes the given command names from the list
  1695.      -s don't show stacksize and type, use old output-format instead
  1696.  
  1697.     Gives status of CLI processes.  eg:
  1698.  
  1699.     Proc Command Name         Typ  Stack  Pri.  Address  Directory
  1700.     * 1  csh                  fr   10000    0      97b0  Stuff:shell
  1701.       2  clock                bw    4096  -10    2101a8  Workdisk:
  1702.       3  emacs                bw   30000    0    212f58  Stuff:shell
  1703.       4  VT100                bw    4000    0    227328  Workdisk:
  1704.  
  1705.     Address is the address of the task, directory is the process
  1706.     currently CD'd directory. My default, only the BaseNames of
  1707.     the commands are shown. Your own CLI will be marked by an
  1708.     asterisk in the first column.
  1709.  
  1710.     Stack size is the _real_ size of a command's stack. It's _not_
  1711.     the size a program gets if it's launched by this command.  Use
  1712.     "Status" instead if you need the size of the Default Stack.
  1713.     (be aware: "Status" does _not_ show the stack size used by a prog!)
  1714.  
  1715.     Typ are two letters.  The first is either "f" (foreground) or
  1716.     "b" (background).  The second is one of:
  1717.         i: invalid
  1718.         a: added
  1719.         r: running / ready to run
  1720.         w: waiting
  1721.         e: except
  1722.         d: removed
  1723.  
  1724.     PWD
  1725.  
  1726.     Usage    : pwd
  1727.  
  1728.     Rebuild _cwd by backtracing from your current directory.
  1729.  
  1730.     QSORT
  1731.  
  1732.     Usage    : qsort [-cr] <in >out
  1733.  
  1734.     Options :
  1735.      -c case-sensitive
  1736.      -r reverse sort
  1737.  
  1738.     Quick sorts from stdin to stdout (case-insensitive).
  1739.  
  1740.     QUIT
  1741.  
  1742.     Usage    : quit
  1743.  
  1744.     Quit out of Shell back to CLI.
  1745.  
  1746.     RBACK
  1747.  
  1748.     Usage    : rback command
  1749.  
  1750.     Start a new process executing the specified command, but can't do
  1751.     input/output. Equivalent to 'run command >NIL: <NIL:'. Instead of
  1752.     using rback, you can add a '&' at the end of the command line.
  1753.  
  1754.     Note: rback cannot start builtin commands. You have to start a
  1755.           subshell: rback csh -c "copy ram:temp prt:;rm ram:temp
  1756.  
  1757.     READFILE
  1758.  
  1759.     Usage    : readfile varname [filename]
  1760.  
  1761.     Completely reads an ASCII file and assigns it to a variable. Each
  1762.     line becomes one word in the resulting string. Embedded blanks
  1763.     are no problem. If file name is omitted, stdin is used. See also
  1764.     'writefile', @subfile and @flines
  1765.  
  1766.     REHASH
  1767.  
  1768.     Usage    : rehash [-cglos]
  1769.  
  1770.     Options :
  1771.      -c clear local program hash list
  1772.      -g clear global program hash list
  1773.      -l load global program hash list into local buffer
  1774.      -o output local program hash list
  1775.      -s save local program hash list to disk
  1776.  
  1777.     Scans the complete DOS search path (see also 'path') and builds a
  1778.     program hash list. This can be used for program name completion from
  1779.     command line (default: ESC-p, ESC-P). And when running commands
  1780.     CShell does not scan DOS search path any more for every command but
  1781.     instead scans the program hash list in memory (minimizes disk access
  1782.     and speeds up running commands significantly).
  1783.  
  1784.     Of course, when you add a directory to your path, when you add
  1785.     programs to the existing path or when you remove directories/programs
  1786.     then you have to rebuild the program hash list.
  1787.  
  1788.     Each invocation of CShell has its own local buffer to hold that
  1789.     program hash list.  Use option -s to save the local list to disk
  1790.     (csh:csh-prgs).  With option -l the list is loaded into memory.
  1791.     The first CShell loading the list puts a copy of it into a global
  1792.     buffer so that next time a CShell wants to load it the global buffer
  1793.     is used and not the disk file.
  1794.  
  1795.     The global list stays in memory -- even if you quit all CShells.
  1796.     Use option -g to free that global list (if you are low on memory),
  1797.     but this does not affect local lists of any currently running CShell.
  1798.     Option -c clears the local list.
  1799.  
  1800.     If you run this command without options the scanned list is not only
  1801.     put into local buffer but also in global buffer.
  1802.  
  1803.     There's no need to clear the local/global list before
  1804.     loading/building a new one. This is done automatically.
  1805.  
  1806.     The variable $_prghash (default: 'csh:csh-prgs') holds the filename
  1807.     where the program hash list is loaded from and saved to.
  1808.  
  1809.     Programs from the hash list are case in-sensitive and may be
  1810.     abbreviated. This can be toggled with the variable "_abbrev".
  1811.     
  1812.     Recommended usage:
  1813.     First run "rehash" from your shell to build the program hash list.
  1814.     Save this list to disk with "rehash -s".  Now include "rehash -l"
  1815.     in "s:.cshrc" to load this list on every invocation of CShell.
  1816.  
  1817.     RELABEL
  1818.  
  1819.     Usage    : relabel drive name
  1820.     Example    : relabel DH0: Picard
  1821.  
  1822.     Change the volume name of the disk in the given drive to the name
  1823.     specified. Volume names are set initially when you format a disk.
  1824.  
  1825.     If you have a floppy disk system with only one disk drive, be sure
  1826.     to specify the disks by volume name, instead of drive name.
  1827.  
  1828.     RENAME (or MV)
  1829.  
  1830.     Usage    : rename [-fv] from to
  1831.     or    : rename [-fv] from from from ... from todir
  1832.  
  1833.     Options :
  1834.      -f don't abort on errors
  1835.      -v verbose mode (print renamed filenames)
  1836.  
  1837.     Allows you to rename a file or move it around within a disk.
  1838.     Allows you to move 1 or more files into a single directory.
  1839.     The archive bit of the file(s) will be cleared.
  1840.  
  1841.  
  1842.     RESIDENT
  1843.  
  1844.     Usage    : resident [-dr] [files]
  1845.     Example    : resident lc1 lc2 blink    # load these as resident
  1846.           resident -d lc1 lc2 blink    # defer load when needed
  1847.           resident -r lc1 lc2 blink    # remove these
  1848.           resident            # list resident programs
  1849.  
  1850.  
  1851.     Options :
  1852.      -d deferred load; 
  1853.      -r remove files from resident list
  1854.  
  1855.     This is DOS resident. Commands are searched by Shell in resident
  1856.     list BEFORE of searching on any external device.
  1857.     Only PURE programs can run as resident, see DOS docs for more info.
  1858.     Option -d is very useful: you can say, in your startup file,
  1859.     resident -d file...file; programs will not be loaded immediately,
  1860.     but only when you will try to load them. This way, you will not
  1861.     waste memory and startup time if you don't use the programs.
  1862.     Old option -a has no more effect.
  1863.  
  1864.     RETURN
  1865.  
  1866.     Usage    : return [n]
  1867.     Example    : return 10
  1868.  
  1869.     Exit from a script file, or quit from shell with optional
  1870.     exit code.
  1871.  
  1872.     RM (or DELETE)
  1873.  
  1874.     Equivalent to DELETE.
  1875.  
  1876.     RPN
  1877.  
  1878.     Usage    : rpn expression
  1879.     Example    : rpn 3 7 *    # Prints the value 21
  1880.  
  1881.     Evaluate an RPN expression, using 32-bit values. In older versions
  1882.     of Shell RPN contained string functions too, but now that strings
  1883.     are handled by specifical commands, these are no more needed.
  1884.     At end of evaluation, RPN prints values on stack, so you can
  1885.     say for instance "rpn $x 2 * | input x" to double the value of
  1886.     variable x.
  1887.     Functions implemented are:
  1888.  
  1889.         + - * /    Obvious meaning; / means integer division, of course
  1890.         %        Module operator e.g. "rpn 7 3 %" answers 1
  1891.         & | ~    Bitwise and, or, not operators
  1892.         > < ==    Tests for greater-than, lower-than, equal. To get
  1893.             a test for >= (or <=), you can use < ! (or > !)
  1894.         !        Logical not operator
  1895.         DUP        Duplicate value on top of stack
  1896.         DROP    Drop value on top of stack
  1897.         SWAP    Swap two values on top of stack
  1898.  
  1899.     To avoid confusion with redirections, > and < operators must be
  1900.     enclosed in quotes e.g.
  1901.  
  1902.         3 2 ">"        # Prints 1
  1903.  
  1904.     RUN
  1905.  
  1906.     Usage    : run prgm args
  1907.     Example    : run emacs test.c
  1908.  
  1909.     Start a new process executing the specified command. This command is
  1910.     not fully reliable: use at your own risk.  See also rback.
  1911.  
  1912.     RXREC
  1913.  
  1914.     Usage    : rxrec [portname]
  1915.  
  1916.     Create an AREXX-compatible port of the specified name (defaults to
  1917.     "rexx_csh"), then puts Shell to sleep waiting for messages on it.
  1918.  
  1919.     CAUTION: the only way to exit from this status is to send to the
  1920.     port the message "bye".
  1921.  
  1922.     Example:
  1923.     Open two Shell's in two separate CLI's. From the first, type:
  1924.  
  1925.         rxrec
  1926.  
  1927.     Now first Shell doesn't respond to keyboard input; instead, it waits
  1928.     for messages on a port called "rexx_csh". Now, from the other, type:
  1929.  
  1930.         rxsend rexx_csh "dir df0:"
  1931.  
  1932.     You will see the listing of df0: in the first Shell.  Experiment as
  1933.     you like, then:
  1934.  
  1935.         rxsend rexx_csh bye
  1936.  
  1937.     And all will return to normal.
  1938.  
  1939.     RXSEND
  1940.  
  1941.     Usage    : rxsend [-lr] portname command...command
  1942.  
  1943.     Options :
  1944.      -r set the variable _result to the result string of the 
  1945.         AREXX command.
  1946.      -l send the whole line as *one* command.
  1947.  
  1948.     Send commands to any program with an AREXX-compatible port. Be aware
  1949.     that every word is sent as a single command!
  1950.  
  1951.     You don't have to load anything to use these command (or rxrec):
  1952.     all you need is a program with the right port.
  1953.  
  1954.     An example is CygnusEdProfessional: here is, for instance, a command
  1955.     to wake it up, load the file test.c and jump to line 20:
  1956.  
  1957.         rxsend rexx_ced cedtofront "open test.c" "jmp to line 20"
  1958.         # rexx_ced is the name of AREXX port for CygnusEd
  1959.  
  1960.  
  1961.     Refer to your application manual for details and for the names
  1962.     of the commands and the port.
  1963.  
  1964.     SEARCH
  1965.  
  1966.     Usage    : search [-abceflnoqrvw] file...file string
  1967.  
  1968.     Search specified files for a string. Only lines containing the
  1969.     specified strings are displayed.
  1970.  
  1971.     If the filename is STDIN (in uppercase), the standard input is
  1972.     used, so you can use search as the destination for a pipe.
  1973.     Example:
  1974.         strings myprog * | search STDIN .library
  1975.     Lists all libraries used in "myprog".
  1976.  
  1977.     Search is very fast if none of the options -w, -e and STDIN was
  1978.     specified and the file fits into memory.
  1979.  
  1980.     Options:
  1981.       -a (abort)   stops search as soon as the pattern was found once
  1982.       -b (binary)  shows only byte offsets instead of lines. If combined
  1983.                    with -n, shows naked numbers.
  1984.       -c (case)    turns ON case sensitivity
  1985.       -e (exclude) lists lines NOT containing the pattern
  1986.       -f (files)   causes only the names of the files in which the pat-
  1987.                    tern was found to be displayed.
  1988.       -l (left)    pattern must be at beginning of line (this is faster
  1989.                    than using a wild card)
  1990.       -n (number)  turns off line numbering
  1991.       -o (only)    finds only whole words
  1992.       -q (quiet)   suppresses printing of file names.
  1993.       -r (recurse) if you specify any directory, all files in that di-
  1994.                    rectory are recursively searched.
  1995.       -v (verbose) shows each file name on a single line. this is auto-
  1996.                    matically turned on if search is redirected
  1997.       -w (wild)    wild card matching. see notes below
  1998.  
  1999.     Notes to wild card matching;
  2000.     - Uses Shell standard matching.
  2001.     - All standard DOS wildcards are allowed * ? [] () | ~ ' #
  2002.     - The WHOLE line must match the string, not only a substring.
  2003.     - String MUST be enclosed in quotes to avoid wildcard expansion
  2004.  
  2005.     Examples:
  2006.         search -cr df0:include ACCESS
  2007.     Find all occurrences of ACCESS (in uppercase) in all files
  2008.     contained in include directory.
  2009.         search -w shell.h "'#define*"
  2010.     Lists only lines of file beginning with (not simply containing)
  2011.     #define. Note the use of ' to escape the special symbol #.
  2012.  
  2013.     SET
  2014.  
  2015.     Usage    : set [name] [=] [string]
  2016.     Example    : set abc hello
  2017.  
  2018.     Set with no args lists all current variable settings.
  2019.     Set with one arg lists the setting for that particular variable.
  2020.     Specifying name and string, stores the string into variable name.
  2021.  
  2022.     Also see the section on special _variables.
  2023.  
  2024.     SETENV
  2025.  
  2026.     Usage    : setenv envvar value
  2027.  
  2028.     Sets an ENV: variable to the given value. The value must be
  2029.     enclosed in quotes if it contains spaces. To retrieve an ENV:
  2030.     variable, just use $envvar anywhere on a command line.
  2031.  
  2032.     SLEEP
  2033.  
  2034.     Usage    : sleep timeout
  2035.     Example    : sleep 10
  2036.  
  2037.     Sleep for 'timeout' seconds, or until ^C typed.
  2038.  
  2039.     SOURCE
  2040.  
  2041.     Usage    : source file [arguments]
  2042.     Example    : source mymake.sh all
  2043.     Result    : batch file 'mymake.sh' called with var _passed = 'all'
  2044.  
  2045.     Execute commands from a file.  You can create SHELL programs in
  2046.     a file and then execute them with this command.  Source'd files
  2047.     have the added advantage that you can have loops in your command
  2048.     files (see GOTO and LABEL).  You can pass SOURCE files arguments
  2049.     by specifying arguments after the file name.  Arguments are passed
  2050.     via the _passed variable (as a single string, a set of words).
  2051.     See _failat variable for script aborting.
  2052.  
  2053.     Long lines may be split by appending a backslash (\) at end of
  2054.     first part. One single line must be shorter than 512 bytes, but
  2055.     the concatenated line can be as long as you want. There is no
  2056.     limit on the length of the concatenated line.
  2057.  
  2058.     Automatic 'sourcing' is accomplished by appending a .sh suffix to
  2059.     the file (no need to set the s-bit) and executing it as you would
  2060.     a C program:
  2061.  
  2062.     --------- file hello.sh ---------
  2063.     foreach i ( $_passed ) "echo yo $i"
  2064.     ---------------------------------
  2065.  
  2066.     $ hello a b c
  2067.     yo a
  2068.     yo b
  2069.     yo c
  2070.  
  2071.     If the last character of a line in a source file is '{', all
  2072.     following lines will appended to the current one and separated
  2073.     by semicolons until the last character of a line is '}'. Those
  2074.     blocks may be nested. You may use comments and unterminated
  2075.     strings within.
  2076.  
  2077.     --------- file login.sh ---------
  2078.     alias complex {
  2079.       echo -n "this alias
  2080.       echo " works!"
  2081.     }
  2082.     ---------------------------------
  2083.  
  2084.     $ login
  2085.     $ complex
  2086.     this   alias   works!
  2087.  
  2088.     SPLIT
  2089.  
  2090.     Usage    : split srcvar dstvar...dstvar
  2091.  
  2092.     Assigns one word of srcvar to every dstvar, the rest of srcvar to
  2093.     the last dstvar.
  2094.     Note: You enter variable NAMES, not variables.
  2095.  
  2096.     STACK
  2097.  
  2098.     Usage    : stack [number]
  2099.     Example    : stack [-s] 8000
  2100.  
  2101.     Options :
  2102.      -s prints size only (pure number, no text).
  2103.  
  2104.     Changes the default stack for this CLI.
  2105.     Without arguments, just prints it.
  2106.  
  2107.     STRHEAD
  2108.  
  2109.     Usage    : strhead varname breakchar string
  2110.     Example    : strhead x . foobar.bas    # Will set x to "foobar"
  2111.  
  2112.     Remove everything after and including the breakchar in 'string' and
  2113.     place in variable 'varname'.
  2114.  
  2115.     STRINGS
  2116.  
  2117.     Usage    : strings [-bnrv] [file1..fileN] [minlength]
  2118.     Example    : strings [-bnrv] c:dir c:list shell 7
  2119.  
  2120.     Options :
  2121.      -r  if you specify any directory, all files in that directory
  2122.          are recursively searched for strings
  2123.      -n  print name of current file in front of each string
  2124.      -b  shows each string enclosed by  '|' characters, so as to expose
  2125.          leading and trailing spaces or tabs.
  2126.      -v  verbose output before each file (filename, minlength)
  2127.  
  2128.     Prints strings contained in specified files (usually binary)
  2129.     with length >= minlength.  Default is 4.
  2130.  
  2131.     You cannot use a filename that represents a number as last
  2132.     argument. If there are no filenames specified, standard input
  2133.     is used, so you can use strings as the destination for a pipe.
  2134.  
  2135.     STRLEFT
  2136.  
  2137.     Usage    : strleft varname string n
  2138.     Example    : strleft x LongString 5    # Will set x to "LongS"
  2139.  
  2140.     Place leftmost n chars of string in variable varname.
  2141.  
  2142.     STRLEN
  2143.  
  2144.     Usage    : strlen varname string
  2145.     Example    : strlen x Hello        # Will set x to "5"
  2146.  
  2147.     Puts len of string in variable varname.
  2148.  
  2149.     STRMID
  2150.  
  2151.     Usage    : strmid varname string n1 [n2]
  2152.     Example    : strmid x LongString 5 3    # Will set x to "Str"
  2153.  
  2154.     Places n2 chars from string, starting at n1, in variable varname.
  2155.     By omitting n2, you get all chars from n1 to end of string.
  2156.  
  2157.     STRRIGHT
  2158.  
  2159.     Usage    : strright varname string n
  2160.     Example    : strright x LongString 5    # Will set x to "tring"
  2161.  
  2162.     Place rightmost n chars of string in variable varname.
  2163.  
  2164.     STRTAIL
  2165.  
  2166.     Usage    : strtail varname breakchar string
  2167.     Example    : strtail x . foobar.bas    # Will set x to "bas"
  2168.  
  2169.     Remove everything before and including the breakchar in 'string' and
  2170.     place in variable 'varname'.
  2171.  
  2172.     TACKON (or ADDPART)
  2173.  
  2174.     Usage    : tackon var pathname filename
  2175.     Example    : tackon x df0:c Dir    # sets x to "df0:c/Dir"
  2176.     or    : tackon x df0: Preferences #sets x to "df0:Preferences"
  2177.  
  2178.     Correctly  adds  a  filename  to a pathname, and puts the result in
  2179.     variable specified.
  2180.  
  2181.     TAIL
  2182.  
  2183.     Usage    : tail [filename] [num]
  2184.     Example    : tail readme 20
  2185.  
  2186.     Display last "num" lines of "filename".    If num is not specified,
  2187.     10 is assumed. If filename is not specified, standard input (stdin)
  2188.     is taken instead.
  2189.  
  2190.     TEE
  2191.  
  2192.     Usage    : tee [file]
  2193.     Example    : cc test.c | tee >error.list
  2194.  
  2195.     Copies stdin to stdout and the given file.
  2196.     If file is omitted, stderr is used.
  2197.  
  2198.     TOUCH
  2199.  
  2200.     Usage    : touch file1 .. fileN
  2201.  
  2202.     Sets DateStamp of the specified files to the current date & resets
  2203.     archive bit.
  2204.  
  2205.     If a file doesn't exist, touch will create an empty one for you.
  2206.  
  2207.     TRUNCATE
  2208.  
  2209.     Usage    : truncate [n]
  2210.     Example : alias | qsort | truncate
  2211.  
  2212.     A filter that truncates the width of stdin to the specified number,
  2213.     trying to account for tab's and escape sequences. If the number is
  2214.     omitted, the current window width is used.
  2215.  
  2216.     TYPE (or CAT)
  2217.  
  2218.     Equivalent to CAT.
  2219.  
  2220.     UNALIAS
  2221.  
  2222.     Usage    : unalias name .. name
  2223.     Example    : unalias vt
  2224.  
  2225.     Delete aliases..
  2226.  
  2227.     UNIQ
  2228.  
  2229.     Usage    : uniq
  2230.  
  2231.     This is a  filter that removes consecutive, duplicated lines in a
  2232.     file.  It is most useful on a sorted file.
  2233.  
  2234.     UNSET
  2235.  
  2236.     Usage    : unset name .. name
  2237.     Example    : unset abc
  2238.  
  2239.     Unset one or more variables.  Deletes them entirely.
  2240.  
  2241.     USAGE
  2242.  
  2243.     Usage    : usage [command...command]
  2244.  
  2245.     If called without arguments, usage gives you a short information
  2246.     on the special characters used. Otherwise, usage shows you the
  2247.     usage of the given commands. Calling a command with a '?' as
  2248.     the only argument will show its usage, too.
  2249.  
  2250.     VERSION
  2251.  
  2252.     Usage    : version
  2253.  
  2254.     Show current version name, & authors.
  2255.  
  2256.     WAITFORPORT
  2257.  
  2258.     Usage    : waitforport portname [seconds]
  2259.     Example    : waitforport rexx_ced 5
  2260.  
  2261.     Waits for a port to come up. Default time is 10 seconds.
  2262.  
  2263.     WHEREIS
  2264.  
  2265.     Usage    : whereis [-r] filename [ device1...deviceN ]
  2266.  
  2267.  
  2268.     Options    :
  2269.      -r look on all drives.
  2270.  
  2271.     If just a file name is given, whereis searches all subdirectories of
  2272.     the current directory for that file. An asterisk '*' is appended to
  2273.     the file. Wild cards are allowed for the file (no asterisk will be
  2274.     appended then), but no path names. If additional arguments are
  2275.     given, whereis searches only these paths, not the current directory.
  2276.  
  2277.     WINDOW
  2278.  
  2279.     Usage    : window [-fblsaq] [dimensions]
  2280.  
  2281.     Options    :
  2282.         -f    (front) Window to front
  2283.         -b    (back)  Window to back
  2284.         -l    (large) Window to maximum size
  2285.         -s    (small) Window to minimum size
  2286.         -a    (activate)
  2287.         -q    (query) Lists screens and windows open
  2288.         -w    (width) Ignore window width for option "-q" (query)
  2289.  
  2290.        Various  operations on CLI window.  If dimensions are specified,
  2291.     they must be in the form x y width height, with values separated by
  2292.     spaces.
  2293.        The  command  "window  -l" may be very useful on PAL machines to
  2294.     get  a  full  PAL  window  from  your login sequence, or if you use
  2295.     overscan WorkBench.
  2296.        Option  -q  gives,  for  each  Screen and Window currently open,
  2297.     title, left edge, top edge, width, height, (depth).
  2298.  
  2299.     WRITEFILE
  2300.  
  2301.     Usage: writefile varname
  2302.  
  2303.     Writes a set of words to stdout, one word per line. Note that the
  2304.     name of the variable (var) must be supplied, not the value ($var).
  2305.  
  2306.  
  2307. IX. SPECIAL VARIABLES
  2308. ---------------------
  2309.  
  2310. There are a number variables, the write variable, that have a side effect on
  2311. your system (e.g.  changing the title bar), and some others, the read
  2312. variables, that tell you something about your environment (e.g.  the current
  2313. shell version).  You can also overlay the write variables with a local
  2314. variable, so any change only takes place while the current context is
  2315. valid.
  2316.  
  2317. LIST OF VARIABLES:
  2318. ------------------
  2319.  
  2320.     _abbrev
  2321.     Holds a number which lets you select the various modes of
  2322.     command-abbreviation:
  2323.  
  2324.       0   internal commands and commands buffered with "rehash"
  2325.           can no longer be abbreviated  (same as "unset _abbrev")
  2326.       1   internal commands can be abbreviated
  2327.       2   commands buffered with "rehash" can be abbreviated,
  2328.           the first (partially) matching command from the list is taken
  2329.       4   commands buffered with "rehash" can be abbreviated,
  2330.           if the command matches a buffered command completely,
  2331.           then this is taken, else the first partially matching
  2332.           command from the list is taken
  2333.       8   if command wasn't found in Cshell's internal program list
  2334.           (built with "rehash"), then search DOS path-list
  2335.  
  2336.     Numbers can be added to combine modes.
  2337.  
  2338.     The main difference between '2' and '4' is that '2' does not
  2339.     recognize a completely matching command if it has already
  2340.     found a partially matching command earlier in the list.  Eg,
  2341.     you type "ed" and you have (in this order) "EdPlayer" and
  2342.     "Ed" in your list, then "Ed" can never be called (except with
  2343.     absolute path). So '4' first seeks for a completely matching
  2344.     command -- and if it cannot find anything then (and only then)
  2345.     it searches for an abbreviated command.
  2346.  
  2347.     Thus it makes obviously no sense to use '2' and '4' together.
  2348.  
  2349.     By default, this variable is set to '5' (1+4).
  2350.  
  2351.     _bground
  2352.     True if the shell was started with a non-interactive input.
  2353.  
  2354.     _clinumber
  2355.     Contains the number (1-20) of current CLI.
  2356.  
  2357.     _clipri
  2358.     Task priority while editing command line.
  2359.     (also affects filename completion)
  2360.  
  2361.     _cquote
  2362.     If set to some value, quotation marks are handled as
  2363.     Commodore-Shell does, so that they are parsable by ReadArgs()
  2364.     (function call in dos.library). Commodore-Shell treats quotes
  2365.     within a string "as as". Only leading quotation marks "quote"
  2366.     other special chars (like spaces). In contrast to UNIX shells
  2367.     where quotation marks always "quote" other chars - regardless
  2368.     of their position. UNIX behavior (_cquote unset) is default.
  2369.  
  2370.     _cwd
  2371.     Holds a string representing the current directory we are in from
  2372.     root.  The SHELL can get confused as to its current directory if
  2373.     some external program changes the directory.  Use PWD to rebuild
  2374.     the _cwd variable in these cases.
  2375.  
  2376.     _debug
  2377.     Debug mode... use it if you dare.  must be set to some value
  2378.  
  2379.     _dirformat
  2380.     Holds a format string for option -z of builtin command "dir".
  2381.     Used to keep aliases short and to bypass problems with dir's
  2382.     format option "-z" (eg, it's not possible to specify other options
  2383.     after -z without using @pickargs/@pickopts).
  2384.  
  2385.     The format string is limited to a maximum of 80 characters.
  2386.  
  2387.     _every
  2388.     Contains the name of a command that is to be executed every time
  2389.     just before the prompt is printed. Do not use this to echo the
  2390.     prompt.
  2391.  
  2392.     _except
  2393.     See EXCEPTION
  2394.  
  2395.     _failat
  2396.     If a command returns with an error code higher than this, the
  2397.     batch file aborts. The default is 20.
  2398.  
  2399.     _hilite
  2400.     Holds the font attributes used for highlighting. One letter for one
  2401.     attribute:
  2402.       b    for bold
  2403.       i    for italic
  2404.       u    for underlined
  2405.       r    for reverse
  2406.       c3   for foreground color 3
  2407.       c3,2 for foreground color 3 and background color 2
  2408.     Any combinations are allowed. _hilite defaults to "c7", in terminal
  2409.     mode to "r".
  2410.  
  2411.     _history
  2412.     This variable is set to a numerical value, and specifies how far
  2413.     back your history should extend. Set it to 0 to disable history,
  2414.     for example if you test your programs for memory leaks. Defaults
  2415.     to 50.
  2416.  
  2417.     _insert
  2418.     Sets the default for insert/overtype mode for command line editing.
  2419.     ESC-i toggles between, but after <RET> the default is set back as
  2420.     indicated by this variable. By default _insert is 1, unsetting
  2421.     _insert will make overtype the default.
  2422.  
  2423.     _ioerr
  2424.     Contains the secondary error code for the last command. Will be
  2425.     changed after every external command and after a failed internal
  2426.     command. See @ioerr( )
  2427.  
  2428.     _kick
  2429.     holds version number of Operating System (version.library),
  2430.     eg, 37, 38, 39, 40, ...
  2431.  
  2432.     _kick2x
  2433.     True if exec.library V37+ could be opened
  2434.     (which means that kickstart 2.0 is around)
  2435.  
  2436.     _kick3x
  2437.     True if exec.library V39+ could be opened
  2438.     (which means that kickstart 3.0 is around)
  2439.  
  2440.     _lasterr
  2441.     Return code of last command executed.  This includes internal
  2442.     commands as well as external comands, so to use this variables
  2443.     you must check it IMMEDIATELY after the command in question.
  2444.  
  2445.     _lcd
  2446.     Holds the name of the last directory. The builtin alias 'dswap'
  2447.     cd's to that directory. If called again, you're back where you
  2448.     were.
  2449.  
  2450.     _man
  2451.     The path and name of your .doc files. Defaults to 'csh:csh.doc'
  2452.  
  2453.     _mappath
  2454.     Cshell allows invocation of foreign shells if a script starts with
  2455.     "#!" or ";!" followed by a command to execute.  To use unmodified
  2456.     Unix scripts pathname-mapping is necessary to convert pathes like
  2457.     "/usr/..." to, eg, "usr:...".  Set _mappath to enable this name-
  2458.     mapping.  By default _mappath is unset ("/usr/" would be inter-
  2459.     preted as relative AmigaDOS path).
  2460.  
  2461.     _maxerr
  2462.     The worst (highest) return value to date.  To use this, you usually
  2463.     set it to '0', then do some set of commands, then check it.
  2464.  
  2465.     _minrows
  2466.     Gives the minimum number of rows a window must have to turn on quick
  2467.     scrolling. Defaults to 34.
  2468.  
  2469.     _nobreak
  2470.     If set to some value, disables CTRL-C.
  2471.  
  2472.     _nomatch
  2473.     If set to some value, don't check patterns if they match.
  2474.     (By default CSH aborts command execution if all patterns does not
  2475.      match. If at least one pattern matches CSH does not abort.)
  2476.  
  2477.     _noreq
  2478.     If set to some value, disables system requesters ("Please insert
  2479.     volume ...."). Turned on in vt200 mode.
  2480.  
  2481.     _passed
  2482.     This variable contains the passed arguments when you SOURCE a file
  2483.     or execute a .sh file.  For instance:
  2484.  
  2485.     test a b c d
  2486.  
  2487.     -------- file test.sh ----------
  2488.     echo $_passed
  2489.     foreach i ( $_passed ) "echo YO $i"
  2490.     --------------------------------
  2491.  
  2492.     _path
  2493.     Tells CShell where to look for executable files. The current direc-
  2494.     tory and the AmigaDOS path will be searched first. The trailing
  2495.     slash for directories is not necessary any more.  The entire path
  2496.     will be searched first for the <command>, then for <command>.sh
  2497.     (automatic shell script sourcing). Example:
  2498.         set _path ram:c,ram:,sys:system,dh1:tools,df0:c
  2499.     (This path has the advantage that these directories need not even
  2500.      exist, that you can access devices (AmigaDOS path only knows
  2501.      volumes under Kick 1.3) and that no disk seeks happen at startup)
  2502.  
  2503.     The usage of _path is NOT recommended anymore, use the AmigaDOS
  2504.     search path instead (builtin command "path").
  2505.  
  2506.     _prghash
  2507.     The filename where the program hash list (command 'rehash')
  2508.     is loaded from and saved to.
  2509.  
  2510.     _prompt
  2511.     This variable now can contain the following control characters:
  2512.      %c  for color change. This highlights your prompt. See _hilite
  2513.      %e  for elapsed time. The time the last command took to execute.
  2514.      %m  for memory. This shows your current memory in K
  2515.      %t  for time. This shows your current time in the format HH:MM:SS
  2516.      %d  for date. This shows the current date in the format DD-MMM-YY
  2517.      %p  for path. This inserts the current path
  2518.      %V  for volume. This inserts the current volume
  2519.      %n  for number. This inserts the current process number
  2520.      %v  for version. This shows the version number of CShell
  2521.      %h  for history. This displays the current history number
  2522.      %f  for free store. This shows the free store on the current drive
  2523.      %r  for pRiority. Inserts the task priority of the current
  2524.      %s  for shells open. Inserts the result of 'howmany'
  2525.      %U  for user. Shows current user (only with "MultiUser" package)
  2526.      %x  for external cmd return code. Yields the last error code
  2527.     The default for prompt is now "%c%p> "
  2528.     The  if  command  will  set the prompt to a '_ ' if commands are
  2529.     disabled while waiting for a 'endif' or 'else' command (interactive
  2530.     mode only).
  2531.  
  2532.     _pipe
  2533.     The directory where temporaries are stored. Default: 'T:'
  2534.  
  2535.     _qcd
  2536.     Holds the name of the file where the all directories on your hard
  2537.     disk are stored. If not set, disables quick cd-ing.
  2538.  
  2539.     _rback
  2540.     Is the name of the command to be the prepended to the command line
  2541.     when '&' was added to it. Defaults to 'rback', can't be a multi
  2542.     word command yet.
  2543.  
  2544.     _rxpath
  2545.     The same as with _path, but this is where CShell looks for .rexx
  2546.     files. Defaults to REXX:
  2547.  
  2548.     _scroll
  2549.     Holds the number of lines to be scrolled at once when quick
  2550.     scrolling is used. If unset or <=1, quick scrolling is off.
  2551.     Defaults to 3.
  2552.  
  2553.     _terminal
  2554.     Indicates whether or not shell was started in terminal mode.
  2555.  
  2556.     _timeout
  2557.     Set the timeout period (in microsends) for the connected terminal to
  2558.     respond to a WINDOW STATUS REQUEST (special Amiga control sequence
  2559.     to get window bounds). Only used in terminal mode, of course.
  2560.  
  2561.     For local usage a small value is sufficient, for remote usage (eg,
  2562.     over a serial line) the value should be much higher (eg, 500000,
  2563.     which a 1/2 second).
  2564.  
  2565.     _titlebar
  2566.     The same control characters as for the _prompt can be used for
  2567.     _titlebar, too. The only difference is that %c is ignored. The
  2568.     titlebar is updated every time before the prompt appears.
  2569.  
  2570.     _verbose
  2571.     If set to 's', turns on verbose mode for source files (every command
  2572.     will be displayed before being executed). If set to 'a', displays
  2573.     all substeps while alias substitution. 'h' will hilight the debug
  2574.     output. Any combination allowed: set _verbose sah
  2575.  
  2576.     _version
  2577.     Contains the version number of the shell, e.g. 510.
  2578.  
  2579.  
  2580. X.   FUNCTIONS
  2581. --------------
  2582.  
  2583.     FUNCTIONS
  2584.     Functions are preceded by an @-sign and may not be abbreviated
  2585.     They must be preceded by a blank and a blank must follow the opening
  2586.     and precede the closing parenthesis. There must be no blank between
  2587.     the function name an the opening parenthesis. Example:
  2588.        echo @info( df0: )
  2589.     (NOTE: Later versions of Shell might allow that functions need not
  2590.            be at the beginning of an argument, so quote any @-signs not
  2591.            used for functions)
  2592.  
  2593.     Functions may be nested. The function names themselves are case
  2594.     sensitive, but the operations (like strcmp) aren't.
  2595.  
  2596.     Functions can be used as commands. They will echo their return value
  2597.     to stdout. Note that they can't be abbreviated and that the function
  2598.     list is searched after the command list. Example:
  2599.         drives          ---> DF0: DH1: DH2: RAM: WB_2.x:
  2600.     Therefore, functions can also be used like this:
  2601.         echo $(drives)
  2602.  
  2603.     So far, functions are not user definable.
  2604.  
  2605.     Note the difference between sets of words and strings. After
  2606.       set var hello world
  2607.     $var is a wordset, but after
  2608.       set var "hello world"
  2609.     var is one string. Although they look the same if echoed, they
  2610.     behave different, for example in 'foreach i ( var ) "echo hi'. The
  2611.     functions @split and @concat convert the two forms.
  2612.  
  2613.  
  2614. LIST OF FUNCTIONS:
  2615. ------------------
  2616.  
  2617.     @abbrev( str1 str2 [len] )
  2618.     true if the first <len> chars of str1 are an abbreviation of str2
  2619.     @abs( num )
  2620.     returns absolute value of <num>
  2621.     @age( file )
  2622.     the age of that file in days, null-string if file not found
  2623.     @age_mins()
  2624.     the age of that file in minutes, null-string if file not found
  2625.     @appsuff( name suffix )
  2626.     appends an suffix ( .ZOO ) to a string if it's not already there
  2627.     @arg( arg ... arg )
  2628.     see @pickargs( )
  2629.     @ask( title item ... item )
  2630.     asks for confirmation of every item and returns the confirmed ones
  2631.     (very similar to @confirm(), but default is negative)
  2632.     @availmem( [type] )
  2633.     returns free 'chip', 'fast' or otherwise total memory
  2634.     @basename( path ... path )
  2635.     returns the file name parts of the paths
  2636.     @center( word len )
  2637.     returns a string of length <len> with <word> centered in it
  2638.     @checkport( portname )
  2639.     indicates if given port exists
  2640.     @clinum( procname )
  2641.     returns the number of the cli identified by a name or a number
  2642.     @complete( abbrev word ... word )
  2643.     returns the first word <abbrev> is an abbreviation of
  2644.     @concat( word word ... word )
  2645.     concats all words in one blank separated string, see @split
  2646.     @confirm( title item ... item )
  2647.     asks for confirmation of every item and returns the confirmed ones
  2648.     (very similar to @ask(), but default is positive)
  2649.     @console( STDIN|STDOUT )
  2650.     tells whether stdin or stdout are interactive (not redirected)
  2651.     @dectohex( number )
  2652.     returns a string representing <number> in hex
  2653.     @delword( word word ... word n )
  2654.     returns a string with the n-th word deleted.
  2655.     @delwords( word word ... word n m )
  2656.     deletes the next m words from the n-th.
  2657.     @dirname( path )
  2658.     strips the base name from a path, just returns the directory
  2659.     @dirs( name name name name )
  2660.     returns the directories among the given file names, see @files
  2661.     @dirstr( lformat file )
  2662.     returns any info (size, date, file comment) about a file
  2663.     @drive( path )
  2664.     outputs the drive ( device ) name associated to <path>
  2665.     @drives( )
  2666.     outputs all available drives
  2667.     @exists( file )
  2668.     tells whether a file exists or not
  2669.     @fileblks( file file ... file )
  2670.     returns the # of blocks needed for the files, incl. dir blocks
  2671.     @filedate( file )
  2672.     returns a string representing the date of the given file
  2673.     @fileinfo
  2674.     Equivalent to @dirstr
  2675.     @filelen( file file ... file )
  2676.     count the total number of bytes of the given files
  2677.     @filenote( file )
  2678.     returns filenote of given file
  2679.     @fileprot( file )
  2680.     returns a string like ---arwed
  2681.     @filereq( title path&pattern filename )
  2682.     brings up the ASL file requester and returns the selected file name
  2683.     @files( file file ... file )
  2684.     gives you the files among those names, no directories. see @dirs
  2685.     @filesize
  2686.     Equivalent to @filelen
  2687.     @flines( varname )
  2688.     counts the number of lines in a readfile-file (faster than @words)
  2689.     @freebytes( path )
  2690.     the number of free bytes on the given path
  2691.     @freeblks( path )
  2692.     the number of free blocks on the given path
  2693.     @freestore( path )
  2694.     the amount of free store on that path, given in K, M and G
  2695.     @getenv( varname )
  2696.     returns the value of the named env: variable
  2697.     @getclass( file )
  2698.     returns the class (type) of the file. See chapter XIV
  2699.     @hextodec( hex-number )
  2700.     returns a string representing <hex-number> in dec
  2701.     @howmany( )
  2702.     indicates the # of shells running
  2703.     @index( string pattern )
  2704.     returns the index of pattern in string (starting at 1),
  2705.     0 if not found
  2706.     @info( path )
  2707.     the corresponding line from the 'info' command, each entry a word
  2708.     @intersect( word1 word2 word3 , word4 word5 word6 )
  2709.     returns all words which are in both lists. see @union, @member
  2710.     @ioerr( num )
  2711.     returns the corresponding error string to num
  2712.     @lookfor( file paths )
  2713.     looks for a file in the current directory and the paths. See $_path
  2714.     @lower
  2715.     lowercases its arguments. see @upper
  2716.     @match( word ... word "pattern" )
  2717.     returns the words in the list that match the DOS-pattern
  2718.     @max( num num ... num )
  2719.     computes the maximum of all given numbers
  2720.     @megs( number )
  2721.     expresses a number in K, M and G (-bytes), rounded correctly
  2722.     @member( word1 word word ... word )
  2723.     tells you if word1 is among the remaining words
  2724.     @min( num num ... num )
  2725.     computes the minimum of all given numbers
  2726.     @mix( arg1 ... argn )
  2727.     randomly mixes its arguments
  2728.     @mounted( device )
  2729.     returns a boolean indicating whether the specified device is mounted,
  2730.     (don't add an extra colon ':' at the end)
  2731.     @nameext( filename )
  2732.     returns all after the last dot of <filename>.
  2733.     @nameroot( filename )
  2734.     returns all before the LAST dot of <filename>.
  2735.     @opt( arg ... arg )
  2736.     see @pickopts( )
  2737.     @pathname( path )
  2738.     obsolete. use @dirname
  2739.     @pickargs( arg ... arg )
  2740.     picks of its arguments those which don't start with a '-'
  2741.     @pickopts( arg ... arg )
  2742.     picks of its arguments those which start which a '-'
  2743.     @rnd( seed )
  2744.     returns a 32 bit random number (default seed is 1);
  2745.     'seed' is optional and can be used to set new seed for @rnd( ),
  2746.     if you use seed=0 then CSH takes current system time as seed
  2747.     @rpn( expression )
  2748.     computes the rpn expression. See rpn command
  2749.     @scrheight( )
  2750.     outputs the current height of the screen the shell is running in
  2751.     @scrwidth( )
  2752.     outputs the current width of the screen the shell is running in
  2753.     @sortargs( name ... name )
  2754.     sorts its arguments alphabetically
  2755.     @sortnum( number ... number )
  2756.     sorts its arguments numerically
  2757.     @split( string )
  2758.     makes each blank separated part of @string a word, see @concat
  2759.     @strcmp( name name )
  2760.     returns -1, 0 or 1 depending of alphabetical comparison
  2761.     (case-sensitive)
  2762.     @stricmp( name name )
  2763.     returns -1, 0 or 1 depending of alphabetical comparison
  2764.     (case-insensitive)
  2765.     @strhead( breakchar string )
  2766.     see strhead command
  2767.     @strleft( string number )
  2768.     see strleft command
  2769.     @strmid( string n1 n2 )
  2770.     see strmid command
  2771.     @strright( string n )
  2772.     see strright command
  2773.     @strtail( breakchar string )
  2774.     see strtail command
  2775.     @subfile( varname n m )
  2776.     like @subwords, but acts on a readfile-file and is faster
  2777.     @subwords( word ... word n m )
  2778.     returns the next m words word of the given list starting from n
  2779.     @tackon( path file )
  2780.     see tackon command
  2781.     @trim( word word word )
  2782.     removes all leading and trailing blanks from the words
  2783.     @unique( word ... word )
  2784.     sorts the arguments and makes each of them unique
  2785.     @union( name ... name , name ... name )
  2786.     returns all names that are in either list. See @intersect, @member
  2787.     @upper( word ... word )
  2788.     upper cases the given words. see @lower
  2789.     @volume( path )
  2790.     returns the volume name in that path or ""
  2791.     @wincols( )
  2792.     returns the number of columns in the current shell window
  2793.     @winheight( )
  2794.     outputs the height of your window in pixels
  2795.     @winleft( )
  2796.     returns the left edge of your window
  2797.     @winrows( )
  2798.     returns the number of lines in the current shell window
  2799.     @wintop( )
  2800.     returns the top edge of your window
  2801.     @winwidth( )
  2802.     outputs the width of your window in pixels
  2803.     @without( name ... name , name ... name )
  2804.     returns all names of list 1 that are not in list 2
  2805.     @word( name ... name n )
  2806.     picks the n-th word from the list.
  2807.     @words( name ... name )
  2808.     returns the number of words in the list.
  2809.  
  2810.  
  2811. XI. MISCELLANEOUS
  2812. -----------------
  2813.  
  2814.     CShell now allows to do quick scrolling in large windows. Quick
  2815.     scrolling means that whenever the cursor reaches the bottom of
  2816.     the window, the text jumps up 3 or more lines at once. However,
  2817.     only the following commands support this:
  2818.         dir, cat, htype, strings, search, truncate, tee
  2819.     You can choose the number of lines to scroll at once by setting
  2820.     the variable _scroll. Unsetting it or setting it to a value <=1
  2821.     completely disables quick scrolling.
  2822.     You can also choose the number lines a window must at least have
  2823.     to turn on the quick scrolling by setting the _minrows variable.
  2824.     (Defaults to 34). Quick scrolling is automatically disabled when
  2825.     the command is redirected. By piping any command to cat, you can
  2826.     force it to quick scroll. Example:  List | cat
  2827.  
  2828.     CShell now can be terminated using the closing gadget in the
  2829.     AmigaDOS 2.0 shell window. Don't execute c:ENDCLI while using
  2830.     the shell. This can cause problems with external commands. The
  2831.     closing button provides a 'quit' command. You can define
  2832.       alias quit "Endcli;\\quit
  2833.     to assert that the CLI window closes when you click the button.
  2834.  
  2835.  
  2836.     EXCEPTIONS
  2837.     If  no  _except variable exists, any command which fails causes the
  2838.     rest of the line to abort as if an ABORTLINE had been executed.  If
  2839.     the _except variable exists, it is of the form:
  2840.  
  2841.     "nnn;commands..."
  2842.  
  2843.     where  nnn  is  some  value  representing  the  minimum return code
  2844.     required  to  cause  an  error.   Whenever a command returns a code
  2845.     which  is  larger  or  equal  to  nnn,  the commands in _except are
  2846.     executed  before  anything.   WHEN _except EXISTS, THE COMMAND LINE
  2847.     DOES  NOT  ABORT AUTOMATICALLY.  Thus, if you want the current line
  2848.     being executed to be aborted, the last command in _except should be
  2849.     an "abortline".
  2850.  
  2851.     Exception  handling  is  disabled  while  in the exception handling
  2852.     routine (thus you can't get into any infinite loops this way).
  2853.  
  2854.     Thus if _except = ";", return codes are completely ignored.
  2855.  
  2856.     Example:
  2857.  
  2858.     set _except "20;abortline"
  2859.  
  2860.  
  2861. XII. EXAMPLE SOURCE FILES
  2862. -------------------------
  2863.  
  2864. If from a CLI or the startup-script you say 'SHELL filename', that file is
  2865. sourced first.
  2866.  
  2867. ### compat.sh ###
  2868.  
  2869. # this makes sure that your old abbreviations don't call new commands
  2870.  
  2871. alias as  aset
  2872. alias cl  close
  2873. alias g   goto
  2874. alias h   help
  2875. alias he  help
  2876. alias m   md
  2877. alias q   quit
  2878. alias re  rename
  2879. alias w   window
  2880.  
  2881. alias kr  "rm -r ram:* >NIL:
  2882.  
  2883. ### End of compat.sh ###
  2884.  
  2885.  
  2886. Moreover, if you have a file called S:.cshrc, it will be sourced for every
  2887. Shell you run. This is useful for aliases and setting that you want in ALL
  2888. Shells.
  2889.  
  2890.  
  2891. ### Example S:.cshrc ###
  2892.  
  2893. Here is an example .cshrc file:
  2894.  
  2895. set F5 "cdir WORK:"^M
  2896. set f9 "ed s:login.sh"^M
  2897. set F9 "ed df0:s/startup-sequence"^M
  2898.  
  2899. alias toram  "%q foreach i ( $q ) \"cp -r $i: ram:$i >NIL:;assign $i: ram:$i
  2900. alias ramop  "md RAM:op; assign OP: ram:op
  2901. alias noop   "assign OP: ; rm -r ram:op
  2902. alias newop  "rm -r OP:*
  2903. alias dc     "dfc df0: to df1:
  2904. alias go     "%q assign WORK: Boot:$q; cd WORK:; source startme.sh
  2905. alias get    "%q cp $q RAM: >NIL:
  2906. alias filter "%a%b%c exec $b \\<$a \\>$c
  2907.     # reads $a, filters it with $b and writes result to $c
  2908.  
  2909. alias rm     "%q \\rm @confirm( Remove $q )
  2910. # or if you want a more safe one
  2911. alias qrm    "%q \\rm @ask( Remove $q )
  2912.  
  2913. #alias rm     "%a set f @pickargs( $a );set opts @pickargs( $a );\
  2914. # e -n OK to delete @words( @files( $f ) ) file(s) and @words( @dirs( $f ) )\
  2915. # directories\"? \";input b;if $b = y;\\rm $opts $f;endif
  2916. #        # for the anxious among us: confirmed rm
  2917.  
  2918. set _prompt   "%c%p> "
  2919.     # this puts the path highlighted in the prompt
  2920.  
  2921. # this one puts cli number, free mem, date and time in title bar
  2922. set _titlebar "Shell %n    Mem %m     Date %d    Time %t
  2923.  
  2924. # This file will be sourced for every Shell you start
  2925.  
  2926. ### End of example .cshrc ###
  2927.  
  2928. ****************************************************************************
  2929.  
  2930. If you are a CLI user, your startup-sequence may be as simple as:
  2931.  
  2932.     C:csh S:startup.sh
  2933.  
  2934. Here's a startup code:
  2935.  
  2936. ### Example S:startup.sh ###
  2937.  
  2938. wind -l    # if you are on a PAL machine, or use overscan
  2939.     # note that commands may be abbreviated (wind=window)
  2940.  
  2941. assign LC: Stuff:c  INCLUDE: Stuff:include   LIB: Boot:lib   QUAD: RAM:
  2942.  
  2943. rback C:FaccII; sleep 1
  2944.     # after spawning a process, it is always better to allow it
  2945.     # to load the command, to avoid excessive drive head movement
  2946.  
  2947. resident -d blink lc1 lc2 >NIL:    #defer loading
  2948.  
  2949. C:PopCli 300 C:Newcli         #using full pathname loads faster
  2950. C:FF -1 Siesta.font >NIL:
  2951. C:Patch_1 >NIL:
  2952. stack 8000            # lc1 and lc2 need this
  2953.  
  2954. source S:setdate.sh        # this is listed next
  2955.  
  2956. ### End of example startup.sh ###
  2957.  
  2958. ****************************************************************************
  2959.  
  2960. The following is an example source file to set date and time; it may be
  2961. used at startup if you don't have an internal clock.
  2962.  
  2963. ### setdate.sh ###
  2964.  
  2965. open CON:200/100/440/80/SetDate write 1
  2966. echo >.1 -n "Current date is "
  2967. date >.1
  2968. echo >.1 -n "Please enter date: "
  2969. input <.1 d
  2970. close 1
  2971. strlen len $d
  2972. if $len > 1 ; date $d ; endif
  2973. echo -n "New date: " ; date
  2974.  
  2975. ### End of setdate.sh ###
  2976.  
  2977. ***************************************************************************
  2978.  
  2979. Next comes a makefile that needs no Make program: may be executed from
  2980. Shell directly!!!
  2981.  
  2982. ### make.sh ###
  2983.  
  2984. if -t Shell.syms Shell.h; cc +HShell.syms Shell.h; rm shell.o; endif
  2985. if -t RAM:Shell.syms Shell.syms; cp -d Shell.syms RAM:; endif
  2986.  
  2987. foreach i ( main comm1 comm2 comm3 execom globals rawconsole run set \
  2988.  sub ) "if -t $i.o $i.c; echo Compile $i...;cc +IRAM:shell.syms $i.c; endif"
  2989.  
  2990. # we used line continuation for better visibility. this is not necessary,
  2991. # you can type it all in one line. no more limit of 256 bytes per line
  2992.  
  2993. if -t Shell run.o main.o comm1.o comm2.o comm3.o execom.o \
  2994. set.o sub.o globals.o rawconsole.o
  2995.     ln  +q -m -o Shell run.o main.o comm1.o comm2.o comm3.o\
  2996.     execom.o set.o sub.o globals.o rawconsole.o -la -lc
  2997. endif
  2998.  
  2999. ### End of make.sh ###
  3000.  
  3001.  
  3002. XIII.  DEFAULT VALUES
  3003. ---------------------
  3004.  
  3005. Some aliases are predefined whenever you start a new Shell. These are:
  3006.  
  3007.     CDIR
  3008.     Use "cdir directory" to clear the screen, set CD to directory,
  3009.     and list it.
  3010.  
  3011.     CLS
  3012.     Simply clear the screen.
  3013.  
  3014.     DSWAP
  3015.     Exchanges current and the previous current directory. For use in
  3016.     scripts as the symbol for last current directory may change.
  3017.  
  3018.     EXIT
  3019.     Leave Shell and exit CLI.
  3020.  
  3021.     MANLIST
  3022.     Display  a list of possible arguments to man.
  3023.  
  3024.     RX
  3025.     Executes a REXX script. Prevents unwanted starting of 'rxrec'.
  3026.  
  3027. Moreover, many variables have default values, and many function keys are
  3028. predefined. You can use set command to determine all of these.
  3029.  
  3030.  
  3031. XIV.  OBJECT ORIENTED FEATURES
  3032. ------------------------------
  3033.  
  3034. File classes are good for two things: Identifying files and command over-
  3035. loading. The latter means that the same command with files of different
  3036. type performs completely different actions.
  3037.  
  3038.     CLASSES OF FILES
  3039.  
  3040.     You can define a class of files using several 'class' commands.
  3041.     Here a simple example:
  3042.  
  3043.       class picture  suff=.pic suff=.iff suff=.ilbm
  3044.       class anim     suff=.anim
  3045.  
  3046.     From now on, everything with the suffix .pic, .iff or .ilbm will
  3047.     be identified as a picture. Please note that there may be no blanks
  3048.     between the names and the '=', and that blanks inside the names
  3049.     must be put in quotes. So these are the ways to identify a file:
  3050.  
  3051.       suff=.doc        True if the suffix of the file is .doc
  3052.       name=readme      True if the file is "readme"
  3053.       name="mod.*"     True if the name starts with 'mod.'
  3054.       offs=14,DC..C4FD True if the bytes starting at $14 are $DC,
  3055.                        anything, $C4, $FD  (all numbers hexadecimal!).
  3056.                        Each pair of dots means one byte ignored.
  3057.       chars            True if 90% of the bytes in the file are 32..127
  3058.                        or 9..13
  3059.       default          Always true, used to define the default type
  3060.  
  3061.     Note that only the first character is examined, so 's' = 'suff'.
  3062.     One class can be identified by more than one 'class' statement.
  3063.     They are looked at in the same sequence they were entered. So to
  3064.     make sure that an zoo archive misnamed as .lzh is identified
  3065.     correctly, use the following 'class' statements:
  3066.  
  3067.       class zoo offs=14,DCA7C4FD
  3068.       class lzh offs=2,2D6C68..2D
  3069.       class zoo suff=.zoo
  3070.       class lzh suff=.lzh
  3071.  
  3072.     Moreover, there is a builtin class 'dir', which means directory.
  3073.     Now we know many file types. But what to do with them? This is
  3074.     where we define 'actions'.
  3075.  
  3076.     ACTIONS ON CLASSES
  3077.  
  3078.     There may be one or more 'class' commands that define what actions
  3079.     need to be taken in various cases for that specific class:
  3080.  
  3081.       class zoo actions view="zoo -list" extr="zoo -extract"
  3082.       class lzh actions view="lz l"      extr="lz e"
  3083.  
  3084.     Whenever somebody tries to 'view' a test.zoo, the command
  3085.     'zoo -list test.zoo' will be issued, but if he tries to
  3086.     view test.lzh, then 'lz l test.lzh' will be executed. Note
  3087.     that any command supplied here goes through the normal csh
  3088.     parser, so AmigaDOS and csh paths will be searched. Aliases
  3089.     with arguments are allowed here, too, so whatever the user
  3090.     typed will be stored in the variable after the '%'.
  3091.  
  3092.     How do I tell a file that I want to 'view' it? There comes the
  3093.     second command used for object oriented features:
  3094.  
  3095.       action view test.zoo
  3096.  
  3097.     will first identify the type of that file and then apply, if
  3098.     possible, the 'view' action to it. Of course, this works best
  3099.     inside an alias:  alias v "action view" will define a v-command
  3100.     that views all types of files known to cshell. Similarly, you
  3101.     can define   alias xtr "action extr" and use this command to
  3102.     extract files from any type of archive.
  3103.     There is one action that will be sent to every file that you
  3104.     try to start but is not executable. This action is 'exec'.
  3105.     Assume you have defined the class 'picture', then after
  3106.  
  3107.       class picture actions view=Mostra exec=Mostra
  3108.  
  3109.     you can display a picture using Mostra by just typing its name.
  3110.     More builtin actions like 'rm' and 'dir' may be implemented,
  3111.     so don't use command names for action names.
  3112.  
  3113.     The batch file class.sh defines a few useful classes.
  3114.  
  3115.     SUPERCLASSES
  3116.  
  3117.     Assume you have a class for .c files, one for .h files, and
  3118.     one for .asm files. You might want to make the difference
  3119.     between them when identifying them, but in the end, they're
  3120.     all ASCII, aren't they? You can stat this with the command
  3121.  
  3122.       class c_source suff=.c is=ascii
  3123.  
  3124.     Now whenever an action on a file of the type c_source fails,
  3125.     the file is interpreted as of type ascii, and the same
  3126.     action is attemted again. This goes on until a class has no
  3127.     more superclass.
  3128.  
  3129.  
  3130. XV.     KEYMAPS
  3131. ---------------
  3132.  
  3133.     You define a keymap as a collection of key/function pairs. Both
  3134.     are given as numbers. There can be several keymaps which activate
  3135.     each other, but at first we only edit keymap 0, which is active
  3136.     at the beginning. All keys you define will eventually overwrite
  3137.     the old definitions in an existing keymap. Everything marked with
  3138.     a (*) is not yet implemented.
  3139.  
  3140.     KEYCODES
  3141.  
  3142.     1..255    The corresponding ASCII character
  3143.     256      Up Arrow
  3144.     257      Down Arrow
  3145.     258      Right Arrow
  3146.     259      Left Arrow
  3147.     260      Help
  3148.     261..270  F1..F10  (unshifted)
  3149.  
  3150.  
  3151.     Modifiers (add them to the key code)
  3152.  
  3153.     512       SHIFT (only necessary for arrows and fkeys)
  3154.     1024      ESC   (was pressed & released before this key)
  3155.  
  3156.     EDITFUNCTIONS
  3157.  
  3158.     - Movement      Move cursor...
  3159.      0  CursLeft    1 left
  3160.      1  CursRight   1 right
  3161.      2  WordLeft    1 word left
  3162.      3  WordRight   1 word right
  3163.      4  BegOfLine   to beginning of line
  3164.      5  EndOfLine   to end of line
  3165.  
  3166.     - Deleting      Delete...
  3167.     10  Backspace   char left from cursor
  3168.     11  Delete      char right from cursor
  3169.     12  BkspcWord   word left from cursor
  3170.     13  DelWord     word right from cursor
  3171.     14  DeleteToSOL to start of line
  3172.     15  DeleteToEOL to end of line
  3173.     16  DeleteLine  whole line
  3174.     17  DelScreen   whole screen and refresh current line
  3175.  
  3176.     - History insert
  3177.     20  Back        Move one line back in history
  3178.     21  Forward     Move one line forward in history
  3179.     22  Beg         Move to first line in history
  3180.     23  End         Move to last line in history
  3181.     24  Complete    History retrieve like '!'
  3182.     25  Exec        Execute history line & bring up next
  3183.     26  Tail        Insert previous line except first word
  3184.     27  Bottom      Go below last history command
  3185.     28  DupWord     Duplicates the last word on this line
  3186.     29  LastPrev    Insert last word of previous line
  3187.  
  3188.     - Completion
  3189.     30  Normal      Insert first matching file (or cycle)
  3190.     31  Partial     Insert common substring of all matching files
  3191.     32  All         Insert all matching files
  3192.     33  Directory   Find dir in quick cd list
  3193.     34  LastCD      Insert last current directory
  3194.     35  Show        Shows all matching files
  3195.     36  CompPrg1    Insert first matching program (or cycle)
  3196.     37  CompPrgAll  Shows all matching programs
  3197.  
  3198.     - Special
  3199.     40  Insert      Toggle Insert/Overwrite
  3200.     41  Quit        Silently perform 'quit'
  3201.     42  Help        Silently perform 'help'
  3202.     43  Refresh     Redraw current line
  3203.     44  Execute     Execute current line
  3204.     45  Leave       Edit new line, store this in hist
  3205.     46  EOF         Terminate shell
  3206.     47  NOP         Do nothing
  3207.     48  Echo^O      Echoes a ^O
  3208.     49  Beep        Echoes a ^G
  3209.  
  3210.     - Other
  3211.     50  Fkey        Execute command associated to last fkey
  3212.     51  Menu        Execute command associated to last menu
  3213.     52  Undo        Undoes last edit
  3214.     53  Repeat      Repeats last function
  3215.     54  SwapChar    Swaps the two chars left of cursor
  3216.     55  QuoteChar   Quote next char
  3217.  
  3218.  
  3219.     Command types
  3220.  
  3221.     0   +x      Editing function x, see above descriptions
  3222.     512 +x      Setmap x,     x=0..7
  3223.     1024+x      Insert key x, x=1..255
  3224.     1536+x      Macro x       x=1..15         (*)
  3225.     2048+x      String x      x=1..15         (*)
  3226.  
  3227.     Examples:
  3228.  
  3229.     keymap 0    66=49    # the  B key will beep
  3230.     keymap 0     2=16    # ^B key will erase line
  3231.     keymap 0  1122=35    # ESC-b will show matching files
  3232.     keymap 0 9=31 521=30 # Swaps TAB and SHIFT-TAB
  3233.  
  3234.     keymap 0 260=47      # do nothing on help
  3235.     keymap 0 12=17       # clear screen and refresh line on ^L
  3236.     keymap 0 18=29       # insert last word of prev line on ^R
  3237.  
  3238.  
  3239. XVI.    SCROLLING
  3240. -----------------
  3241.  
  3242. console.device
  3243. --------------
  3244.  
  3245. Ever wondered why Commodore's shell scroll a standard ASCII text file
  3246. very fast and why CSH scrolls (despite line-buffering in most commands)
  3247. the same text file at a noticable slower speed?
  3248.  
  3249. Now, first of all it must be said that CSH uses the same console
  3250. environment as Commodore's shell does.  So in fact both shells will
  3251. scroll at the SAME speed -- provided that they're configured in a
  3252. similar way.
  3253.  
  3254. Excerpt from "console" autodoc:
  3255.  
  3256. |     V39 console.device takes advantage of the ability to mask
  3257. |     bitplanes for faster scrolling, clearing, and rendering.
  3258. |     The actual number of bitplanes scrolled depends on which
  3259. |     colors you set via the SGR sequences.  For those using
  3260. |     the defaults of PEN color 1, and cell color 0, console.device
  3261. |     only needs to scroll 1 bitplane.  The actual number
  3262. |     of bitplanes scrolled is reset when ESCc is sent, and when
  3263. |     the console window is entirely cleared (e.g., FF).  In
  3264. |     general this should cause no compatability problems, unless
  3265. |     you are mixing console rendering with graphic.library calls
  3266. |     in the same portions of your window.  Console.device considers
  3267. |     the number of bitplanes it must scroll, and the screen display
  3268. |     depth so that interleaved bitplane scrolling can be taken
  3269. |     advantage of in cases where performance is not significantly
  3270. |     affected (interleaved scrolling, and masking are mutually
  3271. |     exclusive).  The determination of how many planes to scroll
  3272. |     is undefined, and may change in the future.
  3273.  
  3274. In other words:
  3275.  
  3276. After opening a window or sending ANSI sequences that clear the window
  3277. (ESC c, FF) the console.device checks how much bitplanes are in use.
  3278. The number of bitplanes depends on the number of colors used in this
  3279. window.
  3280.  
  3281. If there's only 1 color in use (this is default in Commodore's shell)
  3282. then console.device can perform very fast scrolling because only one
  3283. bitplane needs to be scrolled.
  3284.  
  3285. The scroll speed becomes slower the more colors you use.  Lots of
  3286. programs use at least one additional color by default.  This looks
  3287. nice but slows down scrolling.  Besides others, CSH is one of the
  3288. programs that make use of additional colors.  By default CSH has a
  3289. colored prompt.  And some internal commands like "dir" use a color
  3290. to highlight text.
  3291.  
  3292. With the variable "_hilite" you can control how CSH highlights text.
  3293. If you type "set _hilite b" then text will be highlighted by making
  3294. it bold.  See "man _hilite" for further information.
  3295.  
  3296. If you want really fast text scrolling then avoid using colors in text
  3297. output. For example, add "set _hilite b" in your "s:.cshrc" file.  And
  3298. configure other programs (like NewList, a very cool directory lister
  3299. by Phil Dietz) so that they don't use colored output.
  3300.  
  3301. If you have to use colored text (for any reason) then clear the window
  3302. as soon as possible to allow the console.device to re-enable fast text
  3303. scrolling.
  3304.  
  3305. ALWAYS REMEMBER:
  3306.  
  3307. To enable fast scrolling you must clear the screen (ESC c, FF) first.
  3308.  
  3309. As soon as you use more than one color in your text output,
  3310. console.device switches back to normal (slow) scrolling automatically.
  3311. Then you have to clear the screen manually to re-activate optimized
  3312. (fast) scrolling.
  3313.  
  3314.  
  3315. CpuBlit
  3316. -------
  3317.  
  3318. You're running CpuBlit and you wonder why under Kickstart 2.x text
  3319. scrolls faster than under Kickstart 3.x.
  3320.  
  3321. Check if you call CpuBlit with option "-b". This option MUST be set
  3322. to allow CpuBlit the handling of (so called) "broken" bitmaps.
  3323.  
  3324.