
          Unix-Like Utilities for MS-DOS by George Gesslein II
          ----------------------------------------------------

     This archive contains some fast, Unix-like utilities for MS-DOS:

CMP.EXE:	Compare any number of binary files byte by byte for equality.

FGREP.EXE:	Search for lines containing specified string in text files.

L.EXE:		ANSI, multi-column directory command (Like Unix "ls").

LOG.EXE:	Execute a program and redirect stdout and stderr to a file.

M.EXE:		Better MS-DOS more command.

PRINT.EXE:	Simpler MS-DOS print command.

PRINTCOM.EXE:	Send commands to printer.

STRINGS.EXE:	Search for printable strings in binary files and display.

TIMEX.EXE:	Execute a program and display total execution time on exit.

WHICH.EXE:	Find out which program COMMAND.COM would execute.

WHERE.EXE:	Same as "which", but displays all matches in PATH.

     These programs are FREEWARE and permission is granted, to one and all,
to distribute these files as long as all files remain intact.  To contact the
author for the Microsoft C source code, feedback, questions, or whatever,
send e-mail to George Gesslein II:

	e-mail: george2@lightlink.com
	web site: http://www.lightlink.com/george2/


 CMP Program
 -----------
 Usage:  cmp file1 file2 . . .

Quickly compare binary files for equality.  If two files are specified, the
files are compared byte by byte from the beginning of the files until either
of the files ends, then a summary is displayed.  If more than two files are
specified, each file is compared with each other.  Any duplicates are
reported.  Wildcards are allowed in the file names.


 FGREP Program
 -------------
 Usage:  fgrep [-invh] pattern [filenames]

Quickly search text files for lines containing the specified ASCII string
(pattern).  Lines containing the string are displayed, following the file
name.

  The "i" option will cause a case insensitive search.
  The "n" option precedes each line with its line number in the file.
  The "v" option displays lines only if they don't contain the pattern.
  The "h" option suppresses file name display.

The search pattern must be enclosed in double quotes if it contains spaces.
Wildcards are allowed in the file names.  Exit value = 0 if no errors, 1 if
no matches, 2 if any other error occurred.


 L Program
 ---------
 Usage:  l [-clrst1] [pathnames]

This program requires a computer capable of displaying color, and the MS-DOS
ANSI device driver "ansi.sys" must be loaded at boot time by the file
"\config.sys".  Also, after you get the ANSI device driver running, you
should change your DOS prompt to reset the color to what you normally want it
to be, by putting ANSI escape sequences in the MS-DOS "prompt" command in
your "\autoexec.bat" file.  I suggest you try the "prompt" command I use.  It
displays the current drive and directory in blue and makes everything else
green:

	prompt $e[1;34m[$p] $e[0;32m

If you stick the above command line in your "\autoexec.bat" file, you will be
able to exit any ANSI application without it leaving the attributes and
colors something different.  You can change the colors with a little research
in your DOS manual.

By default, this program will list the entire contents of the current
directory, 4 columns wide, in color, using ANSI escape codes.  Normal files
are green, executables are blue, and hidden files are brown.  The files are
preceded with their size in kilobytes, and directories are preceded with a
backslash ("\").

An alphabetical sort is done by default, but this can be changed to a Time
sort using the "t" option or a Size sort using the "s" option.  To reverse
the order of the sort, use the "r" option.

The "l" option (for Long listing) will display the directory in single column
mode, with full information for all of the specified files and directories.

The "1" option will simply list the filenames and directories without any
codes or formatting, so the output can be redirected to a file or to another
program.

The "c" option toggles color mode.  If color mode is turned off, no ANSI
escape sequences will be used.


 LOG Program
 -----------
 Usage:  log program [argument1] . . .

The specified program will be executed with the arguments that follow it.
Standard Output (file handle #1) and Standard Error (file handle #2) will be
redirected to the file "logfile" in the current directory.  This is very
useful with large compilations.  You won't have to watch the display while
your program is slowly compiling.  Everything that would have gone to the
screen goes into "logfile", in the order it would have appeared on the
screen.


 M Program
 ---------
 Usage:  m [filenames]

Display one or more files on the screen, pausing after each screenful.  If no
files are specified, it displays what is piped into it.  Similar to the
MS-DOS "more" command, but better because this command allows multiple file
names with wildcards, output is in color, etc.  Because it uses colors, this
command has the same requirements as the "L" program listed above: ANSI.SYS
must be loaded.

At the "--more--" prompt, press escape or "q" to exit, "n" to skip to the
next file, or any other key to go to the next page.


 PRINT Program
 -------------
 Usage:  print filenames

Send text files to the printer, just like the MS-DOS "print" command, but
doesn't load resident and doesn't print in the backround.  I have experienced
problems with MS-DOS "print", so I wrote this little utility, which is so
simple, nothing can go wrong.  The printer device is assumed to be "PRN:".


 PRINTCOM Program
 ----------------
 Usage:  printcom decimal-or-hexadecimal-codes

Send commands to the printer (device PRN:).  Useful in batch files.  Separate
the codes with spaces and prefix hexadecimal codes with "0x".  The values
cannot exceed 255 decimal or 0xff hexadecimal.


 STRINGS Program
 ---------------
 Usage:  strings [-number] filenames

Search for printable ASCII strings in binary files and display.  If the
"-number" flag is given, then "number" is used as the minimum string length
rather than 4.  Useful for all sorts of things like cheating in a game,
learning about a program without executing it, etc.  Wildcards are allowed in
the file names.


 TIMEX Program
 -------------
 Usage:  timex [program [argument1] . . .]

The specified program will be executed with the arguments that follow it.
The elapsed time between program loading and program termination is
displayed.  More accurate than using a stopwatch.  Executing "timex" with no
arguments will display the current time and date.


 WHICH Program
 -------------
 Usage:  which program-name

This program will search using the DOS PATH environment variable for the
specified program name and displays which directory the program is found in
first.  It uses the same search procedure that "COMMAND.COM" uses, so it
tells you which program is being executed when you type the program name at
the DOS prompt.


 WHERE Program
 -------------
 Usage:  where program-name

This program is the same as "which", except "where" displays all occurrences
of the specified program name in the DOS search path, using the PATH
environment variable.
