home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
rtsi.com
/
2014.01.www.rtsi.com.tar
/
www.rtsi.com
/
OS9
/
TOP
/
USR
/
MAN
/
bm.man
next >
Wrap
Text File
|
2009-11-06
|
3KB
|
138 lines
Bm BASIC UTILITY COMMAND Bm
NNAAMMEE
Bm - fast grep utility
SSYYNNOOPPSSIISS
bm [<opts>] [<expression>] [<path>]
DDEESSCCRRIIPPTTIIOONN
Bm searches the input (standard input default) for lines
matching a string. Normally, each line found is copied to the
standard output. It is blindingly fast. Bm 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 (Exact) only lines matched in their entirety
are printed
-l The names of files with matching lines are
listed (once) separated by newlines.
-c Only a count of the number of matches is printed
-n Each line is preceded by the number of characters
from the beginning of the file to the match.
-s Silent mode. Nothing is printed (except error
messages). This is useful for checking
the error status.
-f <file> The string list is taken from the file.
In all cases the file name is shown if there is more than one
input file.
Care should be taken when using the characters * [ ^ | ( ) and
in the strings (listed on the command line) as they are also
meaningful to the Shell. It is safest to enclose the entire
expression argument in single quotes ' '. Bm searches for lines
that contain one of the (newline-separated) strings, using the
Boyer-Moore algorithm. It is far superior in terms of speed to
the grep family of pattern matchers for fixed-pattern
searching, and its speed increases with pattern length. Exit
status is 0 if any matches are found, 1 if none. 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. Successive matches of different
patterns may appear out of order. A line will be printed once
for each different string on that line. The algorithm cannot
count lines.
AUTHOR: Peter Bain (pdbain@wateng)
Page 1 Printed ( 1 Mai 1988 9:27:57)
Bm BASIC UTILITY COMMAND Bm
EEXXAAMMPPLLEESS
bm #include *.c
bm Mike *.doc
Page 2 Printed ( 1 Mai 1988 9:27:58)