home *** CD-ROM | disk | FTP | other *** search
/ back2roots/padua / padua.7z / padua / shell / csh550.lha / csh.doc < prev    next >
Encoding:
Text File  |  1996-07-19  |  114.4 KB  |  3,436 lines

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