               GREP - Search a file for a given pattern

SYNTAX:

    GREP [-<flag>]* <pattern> <file> [<file>]*

PARAMETERS:

    <flag>      A flag is a single character which modifies the operation of
                the utility. Valid flags are:
            
                C   Display only a count of matching lines (as opposed to
                    displaying all matching lines)
                F   Print file names for only those files with matching lines
                    (as opposed to displaying all files names)
                N   Preceed each matching line with its line number
                V   Display non-matching lines (rather than matching lines)
                T   Truncate lines wider than screen (80 columns)

    <pattern>   A pattern (buzz word "regular expression") for the character
                sequence to search for. Patterns are specified with a string
                of one or more characters. The following characters (buzz
                word "meta-characters") and character sequences have special
                meaning:

                ^   A circumflex at the beginning of a pattern matches the
                    beginning of a line.
                $   A dollar-sign at the end of a pattern matches the end
                    of a line.
                \   The backslash character quotes the following character.
                    For example, "\$" matches a dollar-sign rather than the
                    end of a line.
                .   A period matches any character except the new-line
                    character.
                :x  A colon matches a class of characters described by the
                    succeeding character. ":a" matches any alphabetic
                    character, ":d" matches any digit, ":n" matches any
                    alphanumerics, ": " matches any whitespace (space, tab,
                    and other control characters, such as new-line) character.
                *   An expression followed by an asterisk matches zero or more
                    occurrances of that expression: "fo*" matches "f", "fo"
                    "foo", "fooo", etc.
                +   An expression followed by a plus sign matches one or more
                    occurrances of that expression: "fo+" matches "fo",
                    "foo", "fooo", etc.
                -   An expression followed by a minus sign optionally matches
                    the expression.
                []  A string enclosed in square brackets matches any one of
                    the characters in that string, but no others. If the first
                    character in the string is a circumflex ('^'), the
                    expression matches any character except new-line and the
                    characters in the string. For example, "[xyz]" matches
                    "xx" and "zyx", while "[^xyz]" matches "abc" but not
                    "axb". A range of characters may be specified by two
                    characters separated by "-". Note that, [a-z] matches
                    alphabetics, while [z-a] never matches.

                Any character not mentioned in the above list matches that
                specific character.

                Note that pattern-matching is caseless and blank lines never
                match. It is recommended that the pattern be quoted to prevent
                part of it being translated as a file name.
                
                The concatenation of regular expressions is also a regular
                expression.

    <file>      The pathname for a file (or files) to be searched for
                occurrences of the specified pattern. Pathnames themselves
                may also contain meta-characters (buzz word "wild-card
                pathnames"). In this case, though, only the following meta-
                characters have special meaning:
                
                *   Matches zero or more characters of a file name. "a*d"
                    matches "ad", "abd", "abcd", etc. Note that "*.*" matches
                    any file name whose name contains a '.' (ie, has an
                    extension) and "*" matches any file name (whether or not
                    it has an extension).
                ?   Matches any one character. For example, "a?b" matches
                    "aab", "abb", "acb", etc.
                    
                Note that only the final component of a pathname may be
                specified using a pattern. In other words, you cannot search
                for all of the files in a set of directories which contain a
                specific pattern of characters.

HISTORY:

    The original version of this utility, which ran on Digital Equipment
    Corporation machines, contained this notice which federal law requires
    we present:

        The  information  in  this  document  is  subject  to  change
        without  notice  and  should not be construed as a commitment
        by Digital Equipment Corporation or by DECUS.

        Neither Digital Equipment Corporation, DECUS, nor the authors
        assume any responsibility for the use or reliability of  this
        document or the described software.

                         Copyright (C) 1980, DECUS

        General permission to copy or modify, but not for profit,  is
        hereby  granted,  provided that the above copyright notice is
        included and reference made to  the  fact  that  reproduction
        privileges were granted by DECUS.

    Converted to CP/M-80 (BDS compiler) January 1983, by Chris Kern.
    Converted to IBM PC (CI-C86 Compiler) June 1983, by David N. Smith.
    Converted to RMX (iC-x86 Compilers) July 1989, by N. Scott Pearson, 
    Cableshare Inc.

