home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Simtel MSDOS 1992 December
/
simtel1292_SIMTEL_1292_Walnut_Creek.iso
/
msdos
/
keyboard
/
uncle13.arc
/
UNCLE.DOC
< prev
next >
Wrap
Text File
|
1988-11-08
|
7KB
|
178 lines
========UNCLE - UN*x(c-shell)-like Command Line Editor for MS-DOS========
8 November 1988 (version 1.3)
Jack C. Morrison
14578 Blue Sky Road
Hacienda Heights, CA 91745
jackm@jpl-devvax.jpl.nasa.gov (or elroy.jpl.nasa.gov!jpl-devvax!jackm)
INTRODUCTION
============
UNCLE is a TSR program in the tradition of CED and DOSEDIT, replacing
the DOS buffered input function (0Ah) with enhanced editing and
history capability. The primary differences in UNCLE are
a) UN*X C-shell style history substitutions
b) Personal preference configuration options
STARTUP
======
Install UNCLE with the following command (best put into AUTOEXEC.BAT):
[path]UNCLE [-n] [-ise] [-ose] [-x] [-#c] [-e] [alias_file]
If an unknown option is specified, a usage message is displayed and
UNCLE is not installed. Options can be entered in any order, except
that whichever option -o or -i occurs LAST in the command line
determines the initial insert/overwrite mode UNCLE uses for each call.
Default is to start in insert mode.
-n sets the size of the history buffer in bytes. Default is 512,
minimum is 256. Maximum history+alias size is 40000.
-ise defines the insert mode cursor shape. 'S' and 'e' are hex characters
(0-9 or A-D) indicating the start and end cursor scan lines.
Default is -i0C, which is a full block cursor for monochrome.
(For color displays, only use 0-7 for 's' and 'e').
-ose defines the overwrite mode cursor shape. 'S' and 'e' are as for -i.
Default is -oBD, which is an underline cursor for monochrome.
-x enables translation of slash characters on input: "/" into "\"
and vice-versa. This makes pathname typing easier for
unophiles - use '/' in pathnames, '\' for DOS command options.
Default is disabled.
-#c enables output of a history number before reading input. 'C'
is any character to be output after the number (see example).
Default is not to output anything.
-e bypasses deallocation of the environment segment at startup.
Default is to deallocate it, freeing up a little space which may
or may not be usable. If you use a program that scans the DOS
memory pool and prints program names to show what's loaded, you
may want to use this option. In any case, it's a good idea not to
set any environment variables (including PROMPT and PATH) until
after all your TSR's are loaded.
alias_file is the pathname of an ASCII text file containing alias
definition lines in the form
alias_name alias_value
"Alias_name" should appear at the start of the line, and
there should be exactly one space between the name and value.
Example: try
UNCLE -x -#] -1024 aliases
where the DOS prompt is set to "$p [", and "aliases" contains
pwd cd
h history 15
rm del
ls dir/w
Now you can pretend your PC is running UN*X!
Once installed, UNCLE takes about 8K of memory plus history and
alias buffers. If it gives you trouble, try changing the order
of UNCLE and other TSR startups in your AUTOEXEC.BAT file.
LINE EDITING
============
The usual PC-style line-editing keys are supported:
LEFT, RIGHT move the cursor left or right one column.
^LEFT, ^RIGHT move the cursor left or right one word.
HOME, END move the cursor to the start or end of the line.
BACKSPACE deletes the character left of the cursor.
DEL deletes the character under the cursor.
INSERT toggles insert/overwrite mode.
^U, ^X, ESC, ^HOME delete the entire line.
^END deletes everything after the cursor.
UP, DOWN recall the previous or next history line, if any.
RETURN complete the input.
HISTORY SUBSTITUTION
====================
In addition to the up/down arrow keys, command lines in the history
list can be accessed using a subset of UN*X C-shell history syntax:
!! recall previous command
!n recall history number n
!string recall previous command starting with "string"
!$ recall last word of last command
^old^new[^] replace "old" with "new" in last command
More than one !... substitution can be performed on a line. If any
substitutions are made, the resulting command line is echoed.
The built-in command "history [n]" displays the [last n commands of]
the history buffer (and returns a null string).
A minimal escape mechanism is provided: if the first character of the
line is a space, no history substitutions are performed. For example,
<space>find "!!" foo.c
ALIASES
=======
Aliases defined in the alias_file loaded when UNCLE is installed can
be displayed with the built-in command "alias". After a command line
is input and any history replacement performed, the first word (which
cannot have leading spaces) is compared against the alias list. If
a corresponding definition is found, the alias name is replaced with
the definition in the command line.
NOTES
=====
Sorry about the cutesy name.
If a history or alias replacement results in a command that is too
long for the caller's buffer, it is silently truncated.
Invalid history commands, and built-in commands, return an empty string
to the caller.
UNCLE has been tested on XT and AT clones, with mono, CGA, and EGA.
(You'll want non-default -i and -o values on CGA/EGA.)
PARALEGAL JUNK: I wrote it, I own it, I use it.
You can use it too. Just don't try to sell it, and don't risk anyone's
life on it. Enough of that. Suggestions are welcome, donations are not
required (but not refused). Suggestions accompanied by donations will
probably get more attention (is that bribery?).
ANTI-FEATURES
=============
There is no way to uninstall UNCLE short of rebooting.
Control character inputs are displayed as graphic characters instead
of "^?".
The escape mechanism is crude - you can't, for example, use an alias
but bypass history expansion. Nor can you insert an editing character
into the line.
UNCLE does not differentiate between COMMAND.COM and other callers.
No dynamic or recursive alias definitions.
UNCLE uses more memory than it needs to - initialization code is
not deallocated. Buy me a better C compiler if this bothers you.
CHANGE HISTORY
==============
version 1.0 - initial release
version 1.1 - Fixed alias interpreting to allow terminating ^Z.
Increased stack allocation - this seems to fix problems with
nested command.com's (i.e. Push to DOS).
Cleaned up some problems in document.
version 1.2 - Now I get it! Fixed TSR allocation correctly.
Deallocating Environment block too.
version 1.3 - Added environment deallocate option (some people like
to see the program name in memory block listings)
Added initial-space escape feature. Fixed a little bug with
up/down arrows.