


     BBBBMMMM((((PPPPUUUUBBBBLLLLIIIICCCC))))           UUUUNNNNIIIIXXXX 5555....0000 ((((8888 JJJJuuuullllyyyy 1111999988885555))))            BBBBMMMM((((PPPPUUUUBBBBLLLLIIIICCCC))))



     NNNNAAAAMMMMEEEE
          bm - search a file for a string

     SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
          ////uuuussssrrrr////ppppuuuubbbblllliiiicccc////bbbbmmmm [ option ] ...  [ strings ] [ file ]

     DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
          _B_m searches the input _f_i_l_e_s (standard input default) for
          lines matching a string.  Normally, each line found is
          copied to the standard output.  It is blindingly fast.  _B_m
          strings are fixed sequences of characters: there are no
          wildcards, repetitions, or other features of regular
          expressions.  Bm is also case sensitive.  The following
          options are recognized.

          ----xxxx   (Exact) only lines matched in their entirety are
               printed

          ----llll   The names of files with matching lines are listed
               (once) separated by newlines.

          ----cccc   Only a count of the number of matches is printed

          ----eeee ssssttttrrrriiiinnnngggg
               The string is the next argument after the ----eeee flag. This
               allows strings beginning with '-'.

          ----hhhh   No filenames are printed, even if multiple files are
               searched.

          ----nnnn   Each line is preceded by the number of characters from
               the beginning of the file to the match.

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

          ----ffff _f_i_l_e
               The string list is taken from the _f_i_l_e.

          Unless the ----hhhh option is specified the file name is shown if
          there is more than one input file.  Care should be taken
          when using the characters $ * [ ^ | ( ) and \ in the _s_t_r_i_n_g_s
          (listed on the command line) as 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 ' '.

          _B_m searches for lines that contain one of the (newline-
          separated) _s_t_r_i_n_g_s, using the Boyer-Moore algorithm.  It is
          far superior in terms of speed to the grep (egrep, fgrep)
          family of pattern matchers for fixed-pattern searching, and
          its speed increases with pattern length.



     Page 1                                           (printed 1/1/86)






     BBBBMMMM((((PPPPUUUUBBBBLLLLIIIICCCC))))           UUUUNNNNIIIIXXXX 5555....0000 ((((8888 JJJJuuuullllyyyy 1111999988885555))))            BBBBMMMM((((PPPPUUUUBBBBLLLLIIIICCCC))))



     SSSSEEEEEEEE AAAALLLLSSSSOOOO
          grep(1)

     DDDDIIIIAAAAGGGGNNNNOOOOSSSSTTTTIIIICCCCSSSS
          Exit status is 0 if any matches are found, 1 if none, 2 for
          syntax errors or inaccessible files.

     AAAAUUUUTTTTHHHHOOOORRRR
          Peter Bain (pdbain@wateng), with modifications suggested by
          John Gilmore

     BBBBUUUUGGGGSSSS
          Only 100 patterns are allowed.

          Patterns may not contain newlines.

          If a line (delimited by newlines, and the beginning and end
          of the file) is longer than 8000 charcters (e.g. in a core
          dump), it will not be completely printed.

          If multiple patterns are specified, the order of the ouput
          lines is not necessarily the same as the order of the input
          lines.

          A line will be printed once for each different string on
          that line.

          The algorithm cannot count lines.

          The ----nnnn and ----cccc work differently from fgrep.

          The ----vvvv,,,, ----iiii,,,, and ----bbbb are not available.























     Page 2                                           (printed 1/1/86)



