


      GGGGRRRREEEEPPPP((((1111))))                     ((((UUUUNNNNIIIIXXXX 5555....2222))))                    GGGGRRRREEEEPPPP((((1111))))



      NNNNAAAAMMMMEEEE
           grep, egrep, fgrep - search a file for a pattern

      SSSSYYYYNNNNTTTTAAAAXXXX
           ggggrrrreeeepppp [ options ] expression [ files ]

           eeeeggggrrrreeeepppp [ options ] [ expression ] [ files ]

           ffffggggrrrreeeepppp [ options ] [ strings ] [ files ]

      DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
           Commands of the _g_r_e_p family search the input _f_i_l_e_s (standard
           input default) for lines matching a pattern.  Normally, each
           line found is copied to the standard output.  _G_r_e_p patterns
           are limited regular _e_x_p_r_e_s_s_i_o_ns in the style of _e_d(1); it
           uses a compact non-deterministic algorithm.  _E_g_r_e_p patterns
           are full regular _e_x_p_r_e_s_s_i_o_ns; it uses a fast deterministic
           algorithm that sometimes needs exponential space.  _F_g_r_e_p
           patterns are fixed _s_t_r_i_n_g_s; it is fast and compact.  The
           following _o_p_t_i_o_n_s are recognized:

           ----vvvv    All lines but those matching are printed.
           ----xxxx    (Exact) only lines matched in their entirety are
                 printed (_f_g_r_e_p only).
           ----cccc    Only a count of matching lines is printed.
           ----iiii    Ignore upper/lower case distinction during
                 comparisons.
           ----llll    Only the names of files with matching lines are listed
                 (once), separated by new-lines.
           ----nnnn    Each line is preceded by its relative line number in
                 the file.
           ----bbbb    Each line is preceded by the block number on which it
                 was found.  This is sometimes useful in locating disk
                 block numbers by context. (a block is 1024 bytes.)
           ----ssss    The error messages produced for nonexistent or
                 unreadable files are suppressed (_g_r_e_p only).
           ----eeee _e_x_p_r_e_s_s_i_o_n
                 Same as a simple _e_x_p_r_e_s_s_i_o_n argument, but useful when
                 the _e_x_p_r_e_s_s_i_o_n begins with a ---- (does not work with
                 _g_r_e_p).
           ----ffff _f_i_l_e
                 The regular _e_x_p_r_e_s_s_i_o_n (_e_g_r_e_p) or _s_t_r_i_n_g_s list (_f_g_r_e_p)
                 is taken from the _f_i_l_e.

           In all cases, the file name is output if there is more than
           one input file.  Care should be taken when using the
           characters $$$$, ****, [[[[, ^^^^, |, ((((, )))), and \\\\ in _e_x_p_r_e_s_s_i_o_n, because
           they are also meaningful to the shell.  It is safest to
           enclose the entire _e_x_p_r_e_s_s_i_o_n argument in single quotes
           ''''...''''.

           _F_g_r_e_p searches for lines that contain one of the _s_t_r_i_n_g_s



      Page 1                                                   (9010-E)






      GGGGRRRREEEEPPPP((((1111))))                     ((((UUUUNNNNIIIIXXXX 5555....2222))))                    GGGGRRRREEEEPPPP((((1111))))



           separated by new-lines.

           _E_g_r_e_p accepts regular expressions as in _e_d(1), except for \\\\((((
           and \\\\)))), with the addition of:

           1.    A regular expression followed by ++++ matches one or more
                 occurrences of the regular expression.
           2.    A regular expression followed by ???? matches 0 or 1
                 occurrences of the regular expression.
           3.    Two regular expressions separated by | or by a new-
                 line match strings that are matched by either.
           4.    A regular expression may be enclosed in parentheses (((())))
                 for grouping.

           The order of precedence of operators is [[[[]]]], then ****????++++, then
           concatenation, then | and new-line.

      SSSSEEEEEEEE AAAALLLLSSSSOOOO
           ed(1), sed(1), sh(1).

      DDDDIIIIAAAAGGGGNNNNOOOOSSSSTTTTIIIICCCCSSSS
           Exit status is 0 if any matches are found, 1 if none, 2 for
           syntax errors or inaccessible files (even if matches were
           found).

      BBBBUUUUGGGGSSSS
           Ideally there should be only one _g_r_e_p, but we do not know a
           single algorithm that spans a wide enough range of space-
           time tradeoffs.
           Lines are limited to BUFSIZ characters; longer lines are
           truncated.  (BUFSIZ is defined in ////uuuussssrrrr////iiiinnnncccclllluuuuddddeeee////ssssttttddddiiiioooo....hhhh.)
           _E_g_r_e_p does not recognize ranges, such as [[[[aaaa----zzzz]]]], in character
           classes.
           If there is a line with embedded nulls, _g_r_e_p will only match
           up to the first null; if it matches, it will print the
           entire line.



















      Page 2                                                   (9010-E)



