eeggrreepp -- Command

Extended pattern search
eeggrreepp [-AAbbcceeffhhiillyy] [_p_a_t_t_e_r_n] [_f_i_l_e ...]

eeggrreepp is an extended and faster  version of ggrreepp. It searches each _f_i_l_e for
occurrences of  _p_a_t_t_e_r_n (also called a regular expression).   If no _f_i_l_e is
specified, it  searches the standard input.  Normally,  it prints each line
matching the _p_a_t_t_e_r_n.

_W_i_l_d_c_a_r_d_s
The simplest _p_a_t_t_e_r_n_s  accepted by eeggrreepp are ordinary alphanumeric strings.
Like  eedd,  eeggrreepp  can also  process  _p_a_t_t_e_r_n_s  that  include the  following
wildcard characters:

^   Match beginning  of line, unless it appears  immediately after `[' (see
    below).

$   Match end of line.

*   Match zero or more repetitions of preceding character.

.   Match any character except newline.

[_c_h_a_r_s]
    Match any one of the enclosed _c_h_a_r_s. Ranges of letters or digits may be
    indicated using `-'.

[^_c_h_a_r_s]
    Match any character _e_x_c_e_p_t one of the enclosed _c_h_a_r_s. Ranges of letters
    or digits may be indicated using `-'.

\_c  Disregard special meaning of character _c.

_M_e_t_a_c_h_a_r_a_c_t_e_r_s
In addition, eeggrreepp accepts the following additional metacharacters:

|   Match the preceding pattern _o_r the following pattern.  For example, the
    pattern ccaatt|ddoogg matches either ccaatt or ddoogg. A newline within the _p_a_t_t_e_r_n
    has the same meaning as `|'.

+   Match  one or  more occurrences  of  the immediately  preceding pattern
    element; it  works like `*', except it matches  at least one occurrence
    instead of zero or more occurrences.

?   Match zero or one occurrence of the preceding element of the pattern.

(...)
    Parentheses  may  be  used to  group  patterns.   For example,  (IIvvaann)+
    matches a sequence  of one or more occurrences of  the four letters `I'
    `v' `a' or `n'.

Because the metacharacters  `*', `?', `$', `(', `)', `[',  `]', and `|' are
also special  to the shell, patterns that  contain those literal characters
must be quoted by enclosing _p_a_t_t_e_r_n within apostrophes.

_O_p_t_i_o_n_s
The following lists the available options:

-AA Write  all lines  in which  _e_x_p_r_e_s_s_i_o_n is found  into a  temporary file.
   Then, call  COHERENT with its  error option to process  the source file,
   with the  contents of the  temporary file serving as  an ``error'' list.
   This option  resembles the  -AA option  to the cccc  command, and  lets you
   build a  COHERENT script to make systematic changes  to the source file.
   To  exit COHERENT  and prevent  eeggrreepp  from searching  further, <ccttrrll-UU>
   <ccttrrll-XX> <ccttrrll-CC>.

   Unlike ccggrreepp,  eeggrreepp only  matches patterns that  are on a  single line.
   Some  systems have  a  context ggrreepp  ccggrreepp)  that works  like eeggrreepp  but
   displays  lines  found  in context.   The  COHERENT  eeggrreepp  -AA not  only
   displays lines in context, via COHERENT, it lets you edit them.

-bb With each output line, print the  block number in which the line started
   (used to search file systems).

-cc Print how many lines match, rather than the lines themselves.

-ee The next argument is _p_a_t_t_e_r_n (useful if the pattern starts with `-').

-ff The next argument  is a file that contains a  list of patterns separated
   by newlines; there is no _p_a_t_t_e_r_n argument.

-hh When  more  than  one  _f_i_l_e  is  specified, output  lines  are  normally
   accompanied by the file name; -hh suppresses this.

-ii Ignore case when matches alphabetic letter in _p_a_t_t_e_r_n.  eeggrreepp takes case
   into account, even with this option, when you prefix a letter in _p_a_t_t_e_r_n
   with `\'.

-ll Print the  name of each file  that contains the string,  rather than the
   lines  themselves.  This  is useful  when you  are constructing  a batch
   file.

-nn When a line is printed, also print its number within the file.

-ss Suppress all output, just return exit status.

-vv Print a line only if the pattern is _n_o_t found in the line.

-yy Lower-case letters  in the pattern match only  upper-case letters on the
   input lines.  A  letter escaped with `\' in the  pattern must be matched
   in exactly that case.

_L_i_m_i_t_s
The COHERENT implementation of eeggrreepp sets the following limits on input and
output:

     Characters per input record        512
     Characters per output record       512
     Characters per field               512

_S_e_e _A_l_s_o
aawwkk, ccggrreepp, ccoommmmaannddss, eedd, eexxpprr, ggrreepp, lleexx, sseedd

_D_i_a_g_n_o_s_t_i_c_s
eeggrreepp returns an  exit status of zero for success,  one for no matches, and
two for error.

_N_o_t_e_s
For  matching  patterns in  C  programs, the  command  ccggrreepp is  preferred,
because it is optimized to recognize C-style expressions.

Besides  the difference  in the  range  of patterns  allowed, eeggrreepp  uses a
deterministic finite  automaton (DFA)  for the  search.  It builds  the DFA
dynamically, so  it begins doing useful work  immediately.  This means that
eeggrreepp  is  is  much faster  than  ggrreepp,  often by  more  than  an order  of
magnitude,  and  is  considerably  faster  than  earlier  pattern-searching
commands, on almost any length of file.
