home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Fred Fish Collection 1.5
/
ffcollection-1-5-1992-11.iso
/
ff_disks
/
001-099
/
ff004.lzh
/
bm
/
bm.man
< prev
next >
Wrap
Text File
|
1986-01-01
|
5KB
|
133 lines
BBBBMMMM((((PPPPUUUUBBBBLLLLIIIICCCC)))) UUUUNNNNIIIIXXXX 5555....0000 ((((8888 JJJJuuuullllyyyy 1111999988885555)))) BBBBMMMM((((PPPPUUUUBBBBLLLLIIIICCCC))))
NNNNAAAAMMMMEEEE
bm - search a file for a string
SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
////uuuussssrrrr////ppppuuuubbbblllliiiicccc////bbbbmmmm [ option ] ... [ strings ] [ file ]
DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
_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.
----xxxx (Exact) only lines matched in their entirety are
printed
----llll The names of files with matching lines are listed
(once) separated by newlines.
----cccc Only a count of the number of matches is printed
----eeee ssssttttrrrriiiinnnngggg
The string is the next argument after the ----eeee flag. This
allows strings beginning with '-'.
----hhhh No filenames are printed, even if multiple files are
searched.
----nnnn Each line is preceded by the number of characters from
the beginning of the file to the match.
----ssss Silent mode. Nothing is printed (except error
messages). This is useful for checking the error
status.
----ffff _f_i_l_e
The string list is taken from the _f_i_l_e.
Unless the ----hhhh 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)
BBBBMMMM((((PPPPUUUUBBBBLLLLIIIICCCC)))) UUUUNNNNIIIIXXXX 5555....0000 ((((8888 JJJJuuuullllyyyy 1111999988885555)))) BBBBMMMM((((PPPPUUUUBBBBLLLLIIIICCCC))))
SSSSEEEEEEEE AAAALLLLSSSSOOOO
grep(1)
DDDDIIIIAAAAGGGGNNNNOOOOSSSSTTTTIIIICCCCSSSS
Exit status is 0 if any matches are found, 1 if none, 2 for
syntax errors or inaccessible files.
AAAAUUUUTTTTHHHHOOOORRRR
Peter Bain (pdbain@wateng), with modifications suggested by
John Gilmore
BBBBUUUUGGGGSSSS
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 ----nnnn and ----cccc work differently from fgrep.
The ----vvvv,,,, ----iiii,,,, and ----bbbb are not available.
Page 2 (printed 1/1/86)