home *** CD-ROM | disk | FTP | other *** search
/ rtsi.com / 2014.01.www.rtsi.com.tar / www.rtsi.com / OS9 / OSK / EFFO / pd1.lzh / SYS / HELP / bm.hlp next >
Text File  |  1989-09-03  |  2KB  |  69 lines

  1. @H
  2. @T0
  3. FUNCTION
  4.  
  5.      Bm - fast grep utility 
  6.  
  7. SYNOPSIS 
  8.      bm [<opts>] [<expression>] [<path>] 
  9.  
  10.  
  11. DESCRIPTION 
  12.      Bm   searches  the  input  (standard  input  default)  for  lines
  13.      matching  a   string.  Normally, each line found is copied to the
  14.      standard  output.  It   is  blindingly fast. Bm strings are fixed
  15.      sequences  of  characters:  there  are no wildcards, repetitions,
  16.      or  other  features  of  regular  expressions.   Bm  is also case
  17.      sensitive.  
  18.  
  19. AUTHOR: Peter Bain (pdbain@wateng)
  20. @D1
  21. Options : 2
  22. Notes : 3
  23. Examples : 4
  24. @T2
  25. The following options are recognized:
  26.  
  27.      -x (Exact) only lines matched in their entirety 
  28.         are printed 
  29.  
  30.      -l The names of files with matching lines are 
  31.         listed (once) separated by newlines.  
  32.  
  33.      -c Only a count of the number of matches is printed 
  34.  
  35.      -n Each line is preceded by the number of characters 
  36.         from the beginning of the file to the match.  
  37.  
  38.      -s Silent mode. Nothing is printed (except error  
  39.         messages). This is useful for checking 
  40.         the error status.  
  41.  
  42.      -f <file> The string list is taken from the file.  
  43.  
  44.      In  all  cases  the  file name is shown if there is more than one
  45.      input file.
  46.  
  47. @T3
  48.      Care should  be taken when using the characters * ? @ ^ # < and >
  49.      in  the   strings  (listed  on the command line) as they are also
  50.      meaningful  to  the   Shell.  It  is safest to enclose the entire
  51.      expression  argument in double  quotes " ". Bm searches for lines
  52.      that  contain  one of the  (newline-separated) strings, using the
  53.      Boyer-Moore  algorithm.  It is far  superior in terms of speed to
  54.      the   grep   family   of   pattern  matchers  for   fixed-pattern
  55.      searching,  and  its  speed  increases with pattern length.  Exit
  56.      status  is  0  if  any  matches  are  found,  1 if none. Only 100
  57.      patterns   are  allowed.  Patterns may not contain newlines. If a
  58.      line  (delimited  by   newlines, and the beginning and end of the
  59.      file)  is  longer  than 8000  charcters (e.g. in a core dump), it
  60.      will  not be completely printed.  Successive matches of different
  61.      patterns  may  appear  out of order. A line  will be printed once
  62.      for  each  different  string  on that line. The  algorithm cannot
  63.      count lines.  
  64. @T4
  65. EXAMPLES
  66.      bm #include *.c
  67.      bm Mike *.doc
  68.  
  69.