[comp.sources.amiga] v91i031: CShell 5.00 - alternative command interface, Part05/06

amiga-request@ab20.larc.nasa.gov (Amiga Sources/Binaries Moderator) (03/04/91)

Submitted-by: <umueller@iiic.ethz.ch>
Posting-number: Volume 91, Issue 031
Archive-name: shells/cshell-5.00/part05

#!/bin/sh
# This is a shell archive.  Remove anything before this line, then unpack
# it by saving it into a file and typing "sh file".  To overwrite existing
# files, type "sh file -c".  You can also feed this as standard input via
# unshar, or by typing "sh <file", e.g..  If this archive is complete, you
# will see the following message at the end:
#		"End of archive 5 (of 6)."
# Contents:  shell.doc.ab
# Wrapped by tadguy@ab20 on Sun Mar  3 16:56:01 1991
PATH=/bin:/usr/bin:/usr/ucb ; export PATH
if test -f 'shell.doc.ab' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'shell.doc.ab'\"
else
echo shar: Extracting \"'shell.doc.ab'\" \(33033 characters\)
sed "s/^X//" >'shell.doc.ab' <<'END_OF_FILE'
X	using any MAKE utility.
X	Example:
X	if -t test.o test.asm test.i ; asm -o test.o test.asm ; endif
X
X	Option -r evaluates a given RPN expression (see under RPN for more
X	info): if value on top of stack is 0, then FALSE, else TRUE.
X
X	Switch -n (NOT) reverses the result.
X
X	To test if a given variable is defined, use if -v varname.
X
X	When using 'IF' command interactively if you are entering commands
X	following an 'IF' that was false, the prompt will be set to a
X	underscore '_ ' to indicate all commands will be ignored until
X	an 'ELSE' or 'ENDIF' command is seen.
X
X    INC
X	Usage	: inc varname [value]
X	Example	: inc abc 5
X
X	Increment the numerical equivalent of the variable with specified
X	value (default: 1) and place the ascii-string result back into
X	that variable.
X
X    INFO
X	Usage	: info [path1 path2 ... pathN]
X
X	If called without arguments, info gives you the drive information
X	on all devices. If one or more paths are specified, only infor-
X	mation on those drives will be displayed.
X
X    INPUT
X	Usage	: input [-s] var var ... var
X	Example	: input abc
X
X	Input from STDIN (or a redirection, or a pipe) to a variable.  The
X	next input line is broken up in words (unless quoted) and placed in
X	the variable. If -s is turned on, the whole line is read in as one
X	word, including spaces. -r puts the console to single character mode
X	before reding.
X
X    JOIN
X	Usage	: join [-r] file1..fileN destfile
X	Example	: join part1 part2 part3 total
X
X	Joins the specified files to get destfile. If destfile already
X	exists, an error message is generated and operation is aborted,
X	unless you specify -r (replace) option.
X
X    KEYMAP
X	Usage	: keymap number {key=function}
X	Example	: keymap 0 1030=4 1032=12
X
X	Defines one keymap for the cshell command line editing. See chapter
X	XV.
X
X    LABEL
X	Usage	: label name
X
X	Create a program label right here. Used in source files, can then
X	GOTO a label.
X
X    LINECNT
X	Another filter. Counts the number of lines of its stdin and writes
X	it to stdout.
X
X    LS
X	Equivalent to dir.
X
X    MD
X	Equivalent to mkdir.
X
X    MAN
X	Usage	: man command(s)
X	Example	: man mkdir
X
X	Get  info about a Shell command, or others keywords.  These include
X	all  special  _variables, plus various keywords:  WILDCARDS, PIPES,
X	EDITING, and more.
X	See special alias manlist to get a list of ALL keywords supported
X	by man.
X	You  must set _man to the path of your .doc files:
X	   set _man dh1:docs/shell.doc
X
X    MEM
X	Usage	: mem [-cfqu]
X
X	Options:
X	  -c shows the free chip mem only
X	  -f shows the free fast mem only
X	  -q outputs just a number without titles
X	  -s stores current free memory
X	  -r shows memory used relative to last stored 
X
X    MENU
X	Usage	: menu [-n] [ title item...item ]
X	Example	: menu Shell   JrComm,,j   Rename,"rename ",r  quit
X
X	Appends one pull down in the current console window. Up to six
X	menus with 16 items every can be installed.
X
X	If the item is just a string, that string will be in the menu item.
X	When you select it, it will be put into the prompt and executed.
X
X	If there is a comma and after that comma a second string, this
X	will be the command will be inserted at the prompt. This time you
X	have to add the ^M yourself if you want the command to be executed.
X
X	If there is a second comma, the letter after that comma will be
X	the keyboard shortcut for that menu item. (This will be case 
X	sensitive some day, use lowercase).
X
X	If for any reason your current menu is corrupt, just enter an
X	empty 'menu' command.
X
X	To clear all existing menus use option -n.
X
X    MKDIR (MD)
X	Usage	: mkdir name name name...
X	Example	: mkdir df0:stuff
X
X	Create the specified directories.
X
X    MV
X	Equivalent to rename.
X
X    OPEN
X	Usage	: open filename filemode filenumber
X	Example	: open RAM:data w 1
X
X	This  allows you to open a file, redirect to it as many commands as
X	you like, then close it.
X	Filename is any valid AmigaDOS filename, filemode is either "r" for
X	read or "w" for write, filenumber is a number between 1 and 10.
X	To  redirect  a  program to or from an open file, use as your redir
X	filename a dot followed by the filenumber.
X	Here is a complete example:
X
X		open RAM:data w 1
X		echo -n 2+2= >.1
X		rpn 2 2 + . CR >.1
X		close 1
X		type RAM:data	# will display 2+2=4
X
X	See also close, flist.
X
X    PATH
X	Usage	: path [-r] [dir...dir]
X
X	Without arguments, lists AmigaDOS path. Otherwise adds given directories
X	to the path, preventing duplicate entries.
X	Options:
X	 -r Resets the path
X
X    PRI
X	Usage	: pri clinumber pri
X	Example	: pri 3 5	# set priority of cli #3 to 5
X
X	Change the priority of the specified task (use PS command to
X	determine clinumber). If you specify 0 as clinumber you can
X	change priority of "this" task (the one executing shell).
X
X    PROTECT
X	Usage	: protect file1 ... filen [+|-|=][flags]
X	Example	: protect myfile +rwe
X
X	Set AMIGADOS file protection flags for the file specified. Valid
X	flags are h, s, p, a, r, w, e, d. Modes:
X	  +  Set specified bits, leave all others
X	  -  Clear specified bits, leave all others
X	  =  Set specified bits, clear all others
X	Specifying no mode is equal to '='. Archive bit cleared by default.
X
X    PS
X	Usage	: ps [commandname...commandname]
X
X	Gives status of CLI processes.  eg:
X
X	Proc Command Name	CLI Type    Pri.  Address  Directory
X	* 1  csh			Initial CLI   0      97b0  Stuff:shell
X	  2  clock			Background  -10    2101a8  Workdisk:
X	  3  emacs			Background    0    212f58  Stuff:shell
X	  4  VT100			Background    0    227328  Workdisk:
X
X	Address is the address of the task, directory is the process
X	currently CD'd directory. My default, only the BaseNames of
X	the commands are shown. Your own CLI will be marked by an
X	asterisk in the first column.
X	Options:
X	 -l shows full pathnames of commands
X	 -e excludes the given command names from the list
X
X    PWD
X	Usage	: pwd
X
X	Rebuild _cwd by backtracing from your current directory.
X
X    QSORT
X	Usage   : qsort <in >out
X
X	Quick sorts from stdin to stdout
X
X    QUIT
X	Usage	: quit
X
X	Quit out of Shell back to CLI.
X
X    RBACK
X	Usage	: rback command
X
X	Start a new process executing the specified command, but can't do
X	input/output. Equivalent to 'run command >NIL: <NIL:'.
X	Instead of using rback, you can add a '&' at the end of the command
X	line.
X	Note: rback cannot start builtin commands.
X
X    READFILE
X	Usage	: readfile varname [filename]
X
X	Completely reads a (short!) ascii file and assigns it to a variable.
X	Each line becomes one word in the resulting string. Embedded blanks
X	are no problem, but files longer than 256 lines are. If file name is
X	omitted, stdin is used.
X
X    RENAME (MV)
X	Usage	: rename from to
X	or	: rename from from from ... from todir
X
X	Allows you to rename a file or move it around within a disk.
X	Allows you to move 1 or more files into a single directory.
X	The archive bit of the file(s) will be cleared.
X
X    RESIDENT
X	Usage	: resident [-r][-d] [files]
X	Example	: resident lc1 lc2 blink	# load these as resident
X		  resident -d lc1 lc2 blink	# defer load when needed
X		  resident -r lc1 lc2 blink	# remove these
X		  resident			# list resident programs
X
X	This is ARP resident. Commands are searched by Shell in resident
X	list BEFORE of searching on any external device.
X	Only PURE programs can run as resident, see ARP docs for more info.
X	Option -d is very useful: you can say, in your startup file,
X	resident -d file...file; programs will not be loaded immediately,
X	but only when you will try to load them. This way, you will not
X	waste memory and startup time if you don't use the programs.
X	Old option -a has no more effect.
X
X    RETURN
X	Usage	: return [n]
X	Example	: return 10
X
X	Exit from a script file, or quit from shell with optional
X	exit code.
X
X    RM
X	Equivalent to delete.
X
X    RPN
X	Usage	: rpn expression
X	Example	: rpn 3 7 *	# Prints the value 21
X
X	Evaluate an RPN expression, using 32-bit values. In older versions
X	of Shell RPN contained string functions too, but now that strings
X	are handled by specifical commands, these are no more needed.
X	At end of evaluation, RPN prints values on stack, so you can
X	say for instance "rpn $x 2 * | input x" to double the value of
X	variable x.
X	Functions implemented are:
X
X	    + - * /	Obvious meaning; / means integer division, of course
X	    %		Module operator e.g. "rpn 7 3 %" answers 1
X	    & | ~	Bitwise and, or, not operators
X	    > < ==	Tests for greater-than, lower-than, equal. To get
X			a test for >= (or <=), you can use < ! (or > !)
X	    !		Logical not operator
X	    DUP		Duplicate value on top of stack
X	    DROP	Drop value on top of stack
X	    SWAP	Swap two values on top of stack
X
X	To avoid confusion with redirections, > and < operators must be
X	enclosed in quotes e.g.
X
X		3 2 ">"		# Prints 1
X
X    RUN
X	Usage	: run prgm args
X	Example	: run emacs test.c
X
X	Start a new process executing the specified command.
X	In current implementation run command can't be redirected.
X	This command is not fully reliable: use at your own risk.
X	See also rback.
X
X    RXREC
X	Usage	: rxrec [portname]
X
X	Create an AREXX-compatible port of the specified name (defaults to
X	"rexx_csh"), then puts Shell to sleep waiting for messages on it.
X
X	CAUTION: the only way to exit from this status is to send to the port
X	the message "bye".
X
X	Example:
X	Open two Shell's in two separate CLI's. From the first, type:
X
X		rxrec
X
X	Now first Shell doesn't respond to keyboard input; instead, it waits
X	for messages on a port called "rexx_csh". Now, from the other, type:
X
X		rxsend rexx_csh "dir df0:"
X
X	You will see the listing of df0: in the first Shell. Experiment as you
X	like, then:
X
X		rxsend rexx_csh bye
X
X	And all will return to normal.
X
X    RXSEND
X	Usage	: rxsend [-lr] portname command...command
X
X	Send commands to any program with an AREXX-compatible port. Be aware
X	that every word is sent as a single command!
X
X	You don't have to load anything to use these command (or rxrec):
X	all you need is a program with the right port.
X
X	An example is CygnusEdProfessional: here is, for instance, a command
X	to wake it up, load the file test.c and jump to line 20:
X
X		rxsend rexx_ced cedtofront "open test.c" "jmp to line 20"
X		# rexx_ced is the name of AREXX port for CygnusEd
X
X	The option -r sets the variable _result to the result string
X	of the AREXX command.
X	The option -l send the whole line as *one* command.
X
X	Refer to your application manual for details and for the names
X	of the commands and the port.
X
X    SEARCH
X	Usage	: search [-abcefnqrvw] file...file string
X
X	Search specified files for a string. Only lines containing the
X	specified strings are displayed.
X
X	If the filename is STDIN (in uppercase), the standard input is
X	used, so you can use search as the destination for a pipe.
X	Example:
X		strings myprog 8 | search STDIN .library
X	Lists all libraries used in "myprog".
X
X	Search is very fast if none of the options -w, -e and STDIN was
X	specified and the file fits into memory.
X
X	Options:
X	  -a (abort)   stops search as soon as the pattern was found once
X	  -b (binary)  shows only byte offsets instead of lines. If combined
X	               with -n, shows naked numbers. 
X	  -c (case)    turns ON case sensitivity
X	  -e (exclude) lists lines NOT containing the pattern
X	  -f (files)   causes only the names of the files in which the pat-
X	               tern was found to be displayed.
X	  -l (left)    pattern must be at beginning of line (this is faster
X	               than using a wild card)
X	  -n (number)  turns off line numbering
X	  -o (only)    finds only whole words
X	  -q (quiet)   suppresses printing of file names.
X	  -r (recurse) if you specify any directory, all files in that di-
X	               rectory are recursively searched.
X	  -v (verbose) shows each file name on a single line. this is auto-
X	               matically turned on if search is redirected
X	  -w (wild)    wild card matching. see notes below
X
X	Notes to wild card matching;
X	- Uses Shell standard matching.
X	- All standard ARP wildcards are allowed * ? [] () | ~ ' #
X	- The WHOLE line must match the string, not only a substring.
X	- String MUST be enclosed in quotes to avoid wildcard expansion
X
X	Examples:
X		search -cr df0:include ACCESS
X	Find all occurrencies of ACCESS (in uppercase) in all files
X	contained in include directory.
X		search -w shell.h "'#define*"
X	Lists only lines of file beginning with (not simply containing)
X	#define. Note the use of ' to escape the special symbol #.
X
X    SET
X	Usage	: set [name] [string]
X	Example	: set abc hello
X
X	Set with no args lists all current variable settings.
X	Set with one arg lists the setting for that particular variable.
X	Specifying name and string, stores the string into variable name.
X
X	Also See the section on special _variables.
X
X    SETENV
X	Usage	: setenv envvar value
X
X	Sets an ENV: variable to the given value. The value must be
X	enclosed in quotes if it contains spaces.
X
X    SLEEP
X	Usage	: sleep timeout
X	Example	: sleep 10
X
X	Sleep for 'timeout' seconds, or until ^C typed.
X
X    SPLIT
X	Usage	: split srcvar dstvar...dstvar
X
X	Assigns one word of srcvar to every dstvar, the rest of srcvar to
X	the last dstvar.
X	Note: You enter variable NAMES, not variables.
X
X    STACK
X	Usage	: stack [number]
X	Example	: stack 8000
X
X	Changes the default stack for this CLI. Without arguments, prints
X	it.
X
X    STRHEAD
X	Usage	: strhead varname breakchar string
X	Example	: strhead x . foobar.bas	# Will set x to "foobar"
X
X	Remove everything after and including the breakchar in 'string' and
X	place in variable 'varname'.
X
X    STRINGS
X	Usage	: strings file1..fileN minlenght
X	Example	: strings c:dir c:list shell 7
X
X	Prints strings contained in specified files (usually binary)
X	with lenght >= minlenght.
X
X    STRLEFT
X	Usage	: strleft varname string n
X	Example	: strleft x LongString 5	# Will set x to "LongS"
X
X	Place leftmost n chars of string in variable varname.
X
X    STRLEN
X	Usage	: strlen varname string
X	Example	: strlen x Hello		# Will set x to "5"
X
X	Puts len of string in variable varname.
X
X    STRMID
X	Usage	: strmid varname string n1 [n2]
X	Example	: strmid x LongString 5 3	# Will set x to "Str"
X
X	Places n2 chars from string, starting at n1, in variable varname.
X	By omitting n2, you get all chars from n1 to end of string.
X
X    STRRIGHT
X	Usage	: strright varname string n
X	Example	: strright x LongString 5	# Will set x to "tring"
X
X	Place rightmost n chars of string in variable varname.
X
X    STRTAIL
X	Usage	: strtail varname breakchar string
X	Example	: strtail x . foobar.bas	# Will set x to "bas"
X
X	Remove everything before and including the breakchar in 'string' and
X	place in variable 'varname'.
X
X    SOURCE
X	Usage	: source file [arguments]
X	Example	: source mymake.sh all
X	Result	: source file 'mymake.sh' called with var _passed = 'all'
X
X	Execute commands from a file.  You can create SHELL programs in
X	a file and then execute them with this command.  Source'd files
X	have the added advantage that you can have loops in your command
X	files (see GOTO and LABEL).  You can pass SOURCE files arguments
X	by specifying arguments after the file name.  Arguments are passed
X	via the _passed variable (as a single string).
X
X	Long lines may be split by appending a backslash (\) at end of
X	first half. However, even joined lines cannot be longer than
X	~255 chars. See example of source files.
X
X	Automatic 'sourcing' is accomplished by placing a .sh suffix on
X	the file and executing it as you would a C program:
X
X	--------- file hello.sh ---------
X	foreach i ( $_passed ) "echo yo $i"
X	---------------------------------
X
X	$ hello a b c
X	yo a
X	yo b
X	yo c
X
X    TACKON
X	Usage	: tackon var pathname filename
X	Example	: tackon x df0:c Dir	# sets x to "df0:c/Dir"
X	or	: tackon x df0: Preferences #sets x to "df0:Preferences"
X
X	Correctly  adds  a  filename  to a pathname, and puts the result in
X	variable specified.
X
X    TAIL
X	Usage	: tail filename [num]
X	Example	: tail readme 20
X
X	Display  last  "num" lines of "filename".  If num is not specified,
X	10 is assumed.
X
X    TEE
X	Usage	: tee [file]
X	Example	: cc test.c | tee >error.list
X
X	Copies stdin to stdout and the given file. If file is omitted, sterr
X	is used.
X
X    TOUCH
X	Usage	: touch file1 .. fileN
X
X	Sets DateStamp of the specified files to the current date & resets
X	archive bit.
X
X    TRUNCATE
X	Usage	: truncate [n]
X	Example : alias | sort | truncate
X
X	A filter that truncates the width of stdin to the specified number,
X	trying to account for tab's and escape sequences. If the number is
X	omitted, the current window width is used.
X
X    TYPE
X	Equivalent to CAT.
X
X    UNALIAS
X	Usage	: unalias name .. name
X	Example	: unalias vt
X
X	Delete aliases..
X
X    UNIQ
X	Usage	: uniq
X
X	This is a  filter that removes consecutive, duplicated lines in a
X	file.  It is most useful on a sorted file.
X
X    UNSET
X	Usage	: unset name .. name
X	Example	: unset abc
X
X	Unset one or more variables.  Deletes them entirely.
X
X    USAGE
X	Usage	: usage [command...command]
X
X	If called without arguments, usage gives you a short information
X	on the special characters used. Otherwise, usage shows you the
X	usage of the given commands. Calling a command with a '?' as
X	the only argument will show its usage, too.
X
X    VERSION
X	Usage	: version
X
X	Show current version name, & authors.
X
X    WAITFORPORT
X	Usage	: waitforport portname [seconds]
X
X	Waits for a port to come up. Default time is 10 seconds.
X
X    WHEREIS
X	Usage	: whereis [-r] filename [ device1...deviceN ]
X
X	If just a file name is given, cd searches all subdirectories of the
X	current directory for that file. An asterisk '*' is appended to the
X	file. Wild cards are allowed for the file (no asterisk will be
X	appended then ), but no path names. If additional arguments are
X	given, whereis searches only these paths, not the current directory.
X	whereis -r look on all drives.
X
X    WINDOW
X	Usage	: window [-q][-f][-b][-l][-s] [dimensions]
X	Options	:
X		-f	(front) Window to front
X		-b	(back)  Window to back
X		-l	(large) Window to maximum size
X		-s	(small) Window to minimum size
X		-a	(activate)
X		-q	(query) Lists screens and windows open
X
X	   Various  operations on CLI window.  If dimensions are specified,
X	they must be in the form x y width height, with values separated by
X	spaces.
X	   The  command  "window  -l" may be very useful on PAL machines to
X	get  a  full  PAL  window  from  your login sequence, or if you use
X	overscan WorkBench.
X	   Option  -q  gives,  for  each  Screen and Window currently open,
X	title, left edge, top edge, width, height.
X
X
XIX. SPECIAL SET VARIABLES
X-------------------------
X
X    _bground
X	True if the shell was started with a non-interactive input.
X
X    _clinumber
X	Contains the number (1-20) of current CLI.
X
X    _cwd
X	Holds a string representing the current directory we are in from
X	root.  The SHELL can get confused as to its current directory if
X	some external program changes the directory.  Use PWD to rebuild
X	the _cwd variable in these cases.
X
X    _debug
X	Debug mode... use it if you dare.  must be set to some value
X
X    _every
X	Contains the name of a command that is output every time just before
X	the prompt is printed. Do not use this to echo the prompt.
X
X    _except
X	See EXCEPTION
X
X    _hilite
X	Holds the font attributes used for highlighting. One letter for one
X	attribute:
X	  b    for bold
X	  i    for italic
X	  u    for underlined
X	  r    for reverse
X	  c3   for foreground color 3
X	  c3,2 for foreground color 3 and background color 2
X	Any combinations are allowed. _hilite defaults to "c7", in terminal
X	mode to "r".
X
X    _history
X	This variable is set to a numerical value, and specifies how far
X	back your history should extend. Set it to 0 to disable history,
X	for example if you test your programs for memory leaks. Defaults
X	to 50.
X
X    _insert
X	Sets the default for insert/overtype mode for command line
X	editing. ^A toggles between, but after <RET> the default is
X	set back as indicated by this variable. By default _insert is 1
X	indicating insert mode on setting to zero will make overtype
X	the default.
X
X    _kick2x
X	True if dos.library V36 could be opened (which means that kickstart
X	2.0 is around)
X
X    _lasterr
X	Return code of last command executed.  This includes internal
X	commands as well as external comands, so to use this variables
X	you must check it IMMEDIATELY after the command in question.
X
X    _lcd
X	Holds the name of the last directory. The builtin alias 'dswap'
X	cd's to that directory. If called again, you're back where you
X	were. I highly recommend to put this on a function key.
X
X    _man
X	The name and path to you shell.doc file.
X
X    _maxerr
X	The worst (highest) return value to date.  To use this, you usually
X	set it to '0', then do some set of commands, then check it.
X
X    _minrows
X	Gives the minimum number of rows a window must have to turn on quick
X	scrolling. Defaults to 34.
X
X    _nobreak
X	If set to some value, disables CTRL-C.
X
X    _noreq
X	If set to some value , disables system requesters ("Please insert
X	volume ...."). Turned on in vt200 mode.
X
X    _passed
X	This variable contains the passed arguments when you SOURCE a file
X	or execute a .sh file.  For instance:
X
X	test a b c d
X
X	-------- file test.sh ----------
X	echo $_passed
X	foreach i ( $_passed ) "echo YO $i"
X	--------------------------------
X
X    _path
X	Tells CShell where to look for executable files. The current direc-
X	tory and the AmigaDOS path will be searched first. The trailing
X	slash for directories is not necessary anymore.  The entire path
X	will be searched first for the <command>, then for <command>.sh
X	(automatic shell script sourcing). Example:
X		set _path ram:c,ram:,sys:system,dh1:tools,df0:c
X	(This path has the advantage that these directories need not even
X	 exist, that you can access devices (AmigaDOS path only knows 
X	 volumes under Kick 1.3) and that no disk seeks happen at startup)
X
X    _prompt
X	This variable now can contain the following control characters:
X	 %c  for color change. This highlights your prompt. See _hilite
X	 %m  for memory. This shows your current memory in K
X	 %t  for time. This shows your current time in the format HH:MM:SS
X	 %d  for date. This shows the current date in the format DD-MMM-YY
X	 %p  for path. This inserts the current path
X	 %n  for number. This inserts the current process number
X	 %v  for version. This shows the version number of CShell
X	 %h  for history. This displays the current history number
X	 %f  for free store. This shows the free store on the current drive
X	 %r  for pRiority. Inserts the task priority of the current
X	The default for prompt is now "%c%p> "
X	The  if  command  will  set the prompt to a '_ ' if commands are
X	disabled while waiting for a 'endif' or 'else' command (interactive
X	mode only.
X
X    _qcd
X	Holds the name of the file where the all directories on your hard 
X	disk are stored. If not set, defaults to s:csh-qcd.
X
X    _rxpath
X	The same as with _path, but this is where CShell looks for .rexx
X	files. Defaults to REXX:
X
X    _scroll
X	Holds the number of lines to be scrolled at once when quick scrolling
X	is used. If unset or <=1, quick scrolling is off. Defaults to 3.
X
X    _terminal
X	Indicated whether or not shell was started in terminal mode.
X
X    _titlebar
X	The same control characters as for the _prompt can be used for
X	_titlebar, too. The only difference is that %c is ignored. The
X	titlebar is updated every time before the prompt appears.
X
X    _verbose
X	Verbose mode (for source files).  display commands before they are
X	executed.
X
X    _version
X	Contains the version number of the shell, e.g. 490.
X
X
XX.   FUNCTIONS
X--------------
X
X    FUNCTIONS
X	Functions are preceded by an @-sign and may not be abbreviated
X	They must be preceded by a blank amd a blank must follow the opening
X	and precede the closing brace. There must be no blank between the
X	function name an the opening brace.
X	(NOTE: Later versions of Shell might allow that functions need not
X	       be at the beginning of an argument, so quote any @-signs not
X	       used for functions)
X
X	Functions may be nested. The function names themselves are case
X	sensitive, but the operations (like strcmp) aren't.
X
X	Functions can be used as commands. They will echo their return value
X	to stdout. Note that they can't be abbreviated and that the function
X	list is searched after the command list.
X
X	Note the difference between sets of words and strings. After
X	  set var hello world
X	$var is a wordset, but after
X	  set var "hello world"
X	var is one string. Although they look the same if echoed, they
X	behave different, for example in 'foreach i ( var ) "echo hi'. The
X	 functions @split and @concat convert the two forms.
X
X
X    @abbrev( str1 str2 [len] )
X	true if the first <len> chars of str1 are an abbreviation of str2
X    @abs( num )
X	returns absolute value of <num>
X    @age( file )
X	the age of that file in days, 99999 if file not found
X    @appsuff( name suffix )
X	appends an suffix ( .ZOO ) to a string if it's not already there
X    @availmem( [type] )
X	returns free 'chip', 'fast' or otherwise total memory
X    @basename( file )
X	returns the file name of <file> without path
X    @center( word len )
X	returns a string of length <len> with <word> centered in it
X    @checkport( portname )
X	indicates if given port exists
X    @clinum( procname )
X	returns the number of the cli identified by a name or a number
X    @complete( abbrev word ... word )
X	returns the first word <abbrev> is an abbreviation of
X    @concat( word word ... word )
X	concats all words in one blank separated string, see @split
X    @confirm( title item ... item )
X	asks for confirmation of every item and returns the confirmed ones
X    @dectohex( number )
X	returns a string representing <number> in hex
X    @delword( word word ... word n )
X	returns a string with the n-th word deleted.
X    @delwords( word word ... word n m )
X	deletes the next m words from the n-th.
X    @dirs( name name name name )
X	returns the directories among the given file names, see @files
X    @drive( path )
X	outputs the drive ( device ) name associated to <path>
X    @drives( )
X	outputs all available drives
X    @exists( file )
X	tells whether a file exists or not
X    @fileblks( file file ... file )
X	returns the # of blocks needed for the files, incl. dir blocks
X    @filelen( file file ... file )
X	count the total number of bytes of the given files
X    @fileprot( file )
X	returns a string like ---arwed
X    @filereq( title path&pattern filename )
X	brings up the arp file requester and returns the selected file name
X    @files( file file ... file )
X	gives you the files among those names, no directories. see @dirs
X    @freebytes( path )
X	the number of free bytes on the given path
X    @freeblks( path )
X	the number of free blocks on the given path
X    @freestore( path )
X	the amount of free store on that path, given in K, M and G
X    @getenv( varname )
X	returns the value of the named env: variable
X    @getclass( file )
X	returns the class (type) of the file. See chapter XIV
X    @howmany
X	indicates the # of shells running
X    @index( string pattern )
X	returns the index of pattern in string (starting at 1), 0 if not found
X    @info( path )
X	the corresponding line from the 'info' command, each entry a word
X    @intersect( word1 word2 word3 , word4 word5 word6 )
X	returns all words which are in both lists. see @union, @member
X    @lookfor( file paths )
X	looks for a file in the current directory and the given paths
X    @lower
X	lowercases its arguments. see @upper
X    @match( word ... word "pattern" )
X	returns the words in the list that match the arp-pattern
X    @max( num num ... num )
X	computes the maximum of all given numbers
X    @megs( number )
X	expresses a number in K, M and G (-bytes), rounded correctly
X    @member( word1 word word ... word )
X	tells you if word1 is among the remaining words
X    @min( num num ... num )
X	computes the minimum of all given numbers
X    @nameext( filename )
X	returns all after the last dot of <filename>.
X    @nameroot( filename )
X	returns all before the LAST dot of <filename>.
X    @pathname( path )
X	strips the base name from a path
X    @pickargs( arg ... arg )
X	picks of its arguments those which don't start with a '-'
X    @pickopts( arg ... arg )
X	picks of its arguments those which start witch a '-'
X    @rpn( expression )
X	computes the rpn expression. See rpn command
X    @sortargs( name ... name )
X	sorts its arguments alphabetically
X    @split( string )
X	makes each blank separated part of @string a word, see @concat
X    @strcmp( name name )
X	returns -1, 0 or 1 depending of alphabetical comparison
X    @strhead( breakchar string )
X	see strhead command
X    @strleft( string number )
X	see strleft command
X    @strmid( string n1 n2 )
X	see strmid command
X    @strright( string n )
X	see strright command
X    @strtail( breakchar string )
X	see strtail command
X    @subwords( word ... word n m )
X	returns the next m words word of the given list starting from n
X    @tackon( path file )
X	see tackon command
X    @unique( word ... word )
X	sorts the arguments and makes each of them unique
X    @union( name ... name , name ... name )
X	returns all names that are in either list. See @intersect, @member
X    @upper( word ... word )
X	upper cases the given words. see @lower
X    @volume( path )
X	returns the volume name in that path or "" if no disk present
X    @winheight( )
X	outputs the height of your window in pixels
X    @winleft( )
X	returns the left edge of your window
X    @wintop( )
X	returns the top edge of your window
X    @winwidth( )
X	outputs the width of your window in pixels
X    @without( name ... name , name ... name )
X	returns all names of list 1 that are not in list 2
X    @word( name ... name n )
X	picks the n-th word from the list.
X    @words( name ... name )
X	returns the number of words in the list.
X
X
XXI. MISCELLANEOUS
X-----------------
X
X    QUICK SCROLLING
X	CShell has now allows to do quick scrolling in large windows.
X	Quick scrolling means that whenever the cursor reaches the bottom
X	of the window, the text jumps up 3 or more lines at once. However,
X	only the following commands support this (yet):
X	- dir, cat, htype, strings, search, truncate, tee
X	You can choose the number of lines to scroll at once by setting
X	the variable _scroll. Unsetting it or setting it to a value <=1
X	completely disables quick scrolling.
X	You can also choose the number lines a window must at least have
X	to turn on the quick scrolling by setting the _minrows variable.
X	(Defaults to 34). Quick scrolling is automatically disabled when
X	the command is redirected. By piping any command to cat, you can
X	force it to quick scroll. Example:  List | cat
X
X
X    CLOSING GADGET
X	CShell now can be terminated using the closing gadget in the
X	AmigaDOS 2.0 shell window. Don't execute c:ENDCLI while using
X	the shell. This can cause problems with external commands. The
X	closing button provides a 'quit' command. You can define
X	  alias quit "Endcli;\quit
X	to assert that the CLI window closes when you click the button.
X
X
X    EXCEPTION PROCESSING
X	If  no  _except variable exists, any command which fails causes the
X	rest of the line to abort as if an ABORTLINE had been executed.  If
X	the _except variable exists, it is of the form:
X
X	"nnn;commands..."
X
X	where  nnn  is  some  value  representing  the  minimum return code
X	required  to  cause  an  error.   Whenever a command returns a code
X	which  is  larger  or  equal  to  nnn,  the commands in _except are
X	executed  before  anything.   WHEN _except EXISTS, THE COMMAND LINE
X	DOES  NOT  ABORT AUTOMATICALLY.  Thus, if you want the current line
X	being executed to be aborted, the last command in _except should be
X	an "abortline".
X
X	Exception  handling  is  disabled  while  in the exception handling
X	routine (thus you can't get into any infinite loops this way).
X
X	Thus if _except = ";", return codes are completely ignored.
X
X	Example:
X
X	set _except "20;abortline"
X
X    KNOWN BUGS
X	- under 2.0, doing a 'cat' with no args will cause a character to
X	  appear at the right border of the window. still figuring out...
X	- does not restore old menu strips
X	- guaranteed to crash in extreme low mem situations
X	- command line editing doesn't quite work on a (physical) vt100
X	- under kick 2.00, fast repetition of ^W crashed. OK under 2.02
X	- 'set x a b;echo hello$x' still outputs only 'a b'
X
X    INCOMPATIBILITIES
X
X	Old shell scripts *should* continue to run under Shell 5.00 and
X	above. There are, however, a few minor incompatibilities:
X
X	- 'copy -f' was introduced in 4.02 and meaned "don't set destination
X	  protection bits". It has changed to 'freshen'. Protection bits are
X	  now 'copy -p'.
X	- 0 is now 'false'. Example:
X		if 0;echo hi;else;echo ho;endif        -->  ho
X	- ~ at the beginning of a file name must now be quoted
X	- @ is the beginning of a function should be quotet. No harm is done
X	  (yet) if function is found:
X		echo @foobar                           --> @foobar
X	- the builtin alias 'kr' is gone, because killing ram:* causes
X	  problems under kickstart 2.0 (ENV: is gone). If you're running
X	  1.3, you can put it in your .login.
X	- cat no more appends a CR to the file if stdin is used as input and
X	  stdin is not CR terminated
X	- several abbreviations now call different commands: Typing 'g' now
X	  invokes 'getenv' instead of 'goto'. There is a script 'compat.sh'
END_OF_FILE
if test 33033 -ne `wc -c <'shell.doc.ab'`; then
    echo shar: \"'shell.doc.ab'\" unpacked with wrong size!
fi
# end of 'shell.doc.ab'
fi
echo shar: End of archive 5 \(of 6\).
cp /dev/null ark5isdone
MISSING=""
for I in 1 2 3 4 5 6 ; do
    if test ! -f ark${I}isdone ; then
	MISSING="${MISSING} ${I}"
    fi
done
if test "${MISSING}" = "" ; then
    echo You have unpacked all 6 archives.
    rm -f ark[1-9]isdone
else
    echo You still need to unpack the following archives:
    echo "        " ${MISSING}
fi
##  End of shell archive.
exit 0
-- 
Mail submissions (sources or binaries) to <amiga@uunet.uu.net>.
Mail comments to the moderator at <amiga-request@uunet.uu.net>.
Post requests for sources, and general discussion to comp.sys.amiga.misc.