home *** CD-ROM | disk | FTP | other *** search
/ Crawly Crypt Collection 1 / crawlyvol1.bin / utility / disk / bm / bm.man < prev    next >
Text File  |  1990-01-16  |  3KB  |  92 lines

  1.  
  2.                                                           BM(1)
  3.  
  4.  
  5.  
  6. NAME
  7.      bm - search a file for a string
  8.  
  9. SYNOPSIS
  10.      bm [ option ] ...  [ strings ] [ file ]
  11.  
  12. DESCRIPTION
  13.      Bm searches the input files (standard input default) for
  14.      lines matching a string.  Normally, each line found is
  15.      copied to the standard output.  It is blindingly fast.  Bm
  16.      strings are fixed sequences of characters: there are no
  17.      wildcards, repetitions, or other features of regular expres-
  18.      sions.  Bm is also case sensitive.  The following options
  19.      are recognized.
  20.  
  21.      -x   (Exact) only lines matched in their entirety are
  22.           printed
  23.  
  24.      -l   The names of files with matching lines are listed
  25.           (once) separated by newlines.
  26.  
  27.      -c   Only a count of the number of matches is printed
  28.  
  29.      -e string
  30.           The string is the next argument after the -e flag. This
  31.           allows strings beginning with '-'.
  32.  
  33.      -h   No filenames are printed, even if multiple files are
  34.           searched.
  35.  
  36.      -n   Each line is preceded by the number of characters from
  37.           the beginning of the file to the match.
  38.  
  39.      -s   Silent mode.  Nothing is printed (except error mes-
  40.           sages).  This is useful for checking the error status.
  41.  
  42.      -f path
  43.           The string list is taken from the path. This may be
  44.           either a file or a tty (use -f - on the Atari ST).
  45.  
  46.      Unless the -h option is specified the file name is shown if
  47.      there is more than one input file.  Care should be taken
  48.      when using the characters $ * [ ^ | ( ) and \ in the strings
  49.      (listed on the command line) as they are also meaningful to
  50.      the Shell.  It is safest to enclose the entire expression
  51.      argument in single quotes ' '.
  52.  
  53.      Bm searches for lines that contain one of the (newline-
  54.      separated) strings, using the Boyer-Moore algorithm.  It is
  55.      far superior in terms of speed to the grep (egrep, fgrep)
  56.      family of pattern matchers for fixed-pattern searching, and
  57.      its speed increases with pattern length.
  58.  
  59. SEE ALSO
  60.      grep(1)
  61.  
  62. DIAGNOSTICS
  63.      Exit status is 0 if any matches are found, 1 if none, 2 for
  64.      syntax errors or inaccessible files.
  65.  
  66. AUTHOR
  67.      Peter Bain (pdbain@bnr-vpa), with modifications suggested by
  68.      John Gilmore and Amir Plivatsky.
  69.      Leo de Wit did this Atari ST port.
  70.  
  71. BUGS
  72.      Only 100 patterns are allowed.
  73.  
  74.      Patterns may not contain newlines.
  75.  
  76.      If a line (delimited by newlines, and the beginning and end
  77.      of the file) is longer than 8000 charcters (e.g. in a core
  78.      dump), it will not be completely printed.
  79.  
  80.      If multiple patterns are specified, the order of the ouput
  81.      lines is not necessarily the same as the order of the input
  82.      lines.
  83.  
  84.      A line will be printed once for each different string on
  85.      that line.
  86.  
  87.      The algorithm cannot count lines.
  88.  
  89.      The -n and -c work differently from fgrep.
  90.  
  91.      The -v, -i, and -b are not available.
  92.