4.3BSD-Reno/share/man/cat1/fgrep.0

Compare this file to the similar file:
Show the results in this format:

GREP(1)                     UNIX Reference Manual		       GREP(1)

NNAAMMEE
     ggrreepp - File pattern searcher.

SSYYNNOOPPSSIISS
     ggrreepp [--bbcchhiillnnoossvvww] [--ee _p_a_t_t_e_r_n] [_f_i_l_e ...]
     eeggrreepp [--bbcchhiillnnoossvv] [--ee _p_a_t_t_e_r_n] [--ff _p_a_t_t_e_r_n__f_i_l_e] [_f_i_l_e ...]
     ffggrreepp [--bbcchhiillnnoossvvxx] [--ee _p_a_t_t_e_r_n] [--ff _p_a_t_t_e_r_n__f_i_l_e] [_f_i_l_e ...]

DDEESSCCRRIIPPTTIIOONN
     The ggrreepp utilities search the given input files selecting lines which
     match one or more patterns; the type of patterns is controlled by the op-
     tions specified.  By default, a pattern matches an input line if any reg-
     ular expression (RE) in the pattern matches the input line without its
     trailing <new-line>.  A null RE matches every line.  Each input line that
     matches at least one of the patterns is written to the standard output.

     For simple patterns or ex(1) or ed(1) style regular expressions, the ggrreepp
     utility is used.  The eeggrreepp utility can handle extended regular expres-
     sions and embedded <newline>s in pattern FFggrreepp is quick but is designed
     to handle fixed strings.  A fixed string is a string of characters, each
     character is matched only by itself.  The pattern value can consist of
     multiple lines with embedded <newline>s.  In this case, the <newline>s
     act as alternation characters, allowing any of the pattern lines to match
     a portion of the input.

     The following options are available:

     --bb        The block number on the disk in which a matched pattern is lo-
	       cated is displayed in front of the respective matched line.

     --cc        Only a count of selected lines is written to standard output.

     --ee _e_x_p_r_e_s_s_i_o_n
	       Specify a pattern used during the search of the input.
	       Multiple --ee options can be used to specify multiple patterns;
	       an input line is selected of it matches any of the specified
	       patterns.

     --ff _p_a_t_t_e_r_n__f_i_l_e
	       The pattern is read from the file named by the pathname
	       pattern_file.  Trailing newlines in the pattern_file are
	       ignored.  (eeggrreepp and ffggrreepp only).

     --hh        Never print filename headers with output lines.

     --ii        The case of letters is ignored in making comparisons - that is,
	       upper and lower case are considered identical.

     --ll        Only the names of files containing selected lines are written
	       to standard output.  Pathnames are listed once per file
	       searched.  If the standard input is searched, the pathname `--'
	       is written.

     --nn        Each output line is preceded by its relative line number in the
	       file; each file starting at line 1.  The line number counter is
	       reset for each file processed.  This option is ignored if --cc,
	       --ll, or --ss is specified.

     --oo        Always print filename headers with output lines.

     --ss        Silent mode.  Nothing is printed (except error messages).  This
	       is useful for checking the error status.

     --vv        Selected lines are those _n_o_t matching the specified patterns.
     --xx        Only input lines selected against an entire fixed string or
	       regular expression are considered to be matching lines.	(ffggrreepp
	       only).

     --ww        The expression is searched for as a word (as if surrounded by
	       `\<' and `\>', see ex(1).) (ggrreepp only)

     If no file arguments are specified, the standard input is used.

     The ggrreepp utility exits with one of the following values:

	   0	 One or more lines were selected.
	   1	 No lines were selected.
	   >1	 An error occurred.


EEXXTTEENNDDEEDD RREEGGUULLAARR EEXXPPRREESSSSIIOONNSS
     The following characters are interpreted by eeggrreepp:

     $$	   Align the match from the end of the line.

     ^^	   Align the match from the beginning of the line.

     ||	   Add another pattern (see example below).

     ??	   Match 1 or less sequential repetitions of the pattern.

     ++	   Match 1 or more sequential repetitions of the pattern.

     **	   Match 0 or more sequential repetitions of the pattern.

     [[]]    Match any single character or range of characters enclosed in the
	   brackets.

     \\	   Escape special characters which have meaning to eeggrreepp, the set of
	   {$,.,^,[,],|,?,+,*,(,)}.

EEXXAAMMPPLLEESS
     To find all occurances of the word patricia in a file:

	   grep patricia myfile

     To find all occurences to the pattern `.Pp' at the beginning of a line:

	   grep '^\.Pp'

     The apostrophys assure the entire expression is evaluated by ggrreepp instead
     of by the users shell.  The carat or hat `^' means _f_r_o_m _t_h_e _b_e_g_i_n_n_i_n_g _o_f
     _a _l_i_n_e, and the `\' escapes the `.' which would otherwise match any char-
     acter.

     A simple example of an extended regular expression:

	   egrep '19|20|25' calendar

     Peruses the file calendar looking for either 19, 20 or 25.

SSEEEE AALLSSOO
     ed(1), ex(1), sed(1)

HHIISSTTOORRYY
     GGrreepp appeared in Version 6 AT&T Unix.

BBUUGGSS
     Lines are limited to 256 characters; longer lines are truncated.