Filters in general:

In case you have never played with MORE, FIND, or SORT on the DOS
command line (in Windows or DOS), here is a brief explanation of what
they are and what they do.

Filters are special programs that always read their data from something
called "standard input" and send their output to "standard output".
Standard input is usually the keyboard, and standard output is usually
the screen.  However, both of these can be "redirected" wherever you
want them to go using the "<" and ">" symbols.  For example,

                SORT <INPUT.DAT >OUTPUT.DAT

causes the SORT filter to read its input from INPUT.DAT, sort that data,
and place the sorted output into OUTPUT.DAT. If you tried

                SORT <INPUT.DAT

SORT would get its input from INPUT.DAT and send the sorted data to the
screen.

Can you guess what the next line will do?

                SORT >OUTPUT.DAT

That's right, it will read its data from the keyboard and send the
sorted output to the file OUTPUT.DAT!  This means that sort will wait
for you to type data, and will continue to read your data until you
either stop the input with a Control-Z (or F6), run out of memory, or
turn off the machine! After you enter F6, the sorted data will appear on
the screen.

For a useful example of this, try

                DIR *.BAS >DIR.LST
                SORT <DIR.LST >DIRSORT.LST

(There is a neater way to this, which I'll get into soon.)

MORE is a filter, too, with (I presume) some forced reads from the
keyboard at each pause.

FIND is also a filter, but it can read parms from the command line (like
MORE should, but doesn't.)  The first parm it wants is a search string
in double quotes.  The second parm is an optional file name.  If you
don't supply a filename, FIND will read standard input.

Now for pipes:

PIPES and FILTERS originally appeared in UNIX.  PIPES are much more
powerful in UNIX than DOS and Windows, but even ours can be very useful.

PIPES, simply put, are several FILTERS strung out with each FILTER's
output becoming the input to the next.  For example, the sorted
directory listing in the last example could have been produced with

                DIR *.BAS | SORT >DIRSORT.LST

This would result in the same thing but doesn't leave extra files
hanging around (like DIR.LST in the previous example.)

The "|" (located above the backslash "\" and next to "z") is the symbol
for a PIPE and is best used with spaces before and after.  Sometimes DOS
has problems separating the "|" from filenames in the parameters and get
confused if the "|" is not preceeded by a space.
