COHERENT manpages

This page displays the COHERENT manpage for grep [Pattern search].

List of available manpages
Index


grep -- Command

Pattern search

grep searches each file for  occurrences of the pattern (sometimes called a
regular expression).   If no file is specified,  grep searches the standard
input.  The  pattern is given in  the same manner as  to ed. Normally, grep
prints each line matching the pattern.

grep recognizes the following command-line options:

-b  With each output line, print the block number in which the line started
    (used to search file systems).

-c  Print the count of matching lines rather than the lines.

-e  The next argument is pattern (useful if the pattern starts with `-').

-f  The next argument  is a file that contain a  list of patterns separated
    by newlines; there is no pattern argument.

-h  When  more  than  one file  is  specified,  output  lines are  normally
    accompanied by the file name; -h suppresses this.

-i  Ignore case  when matching letters in pattern.  For  example, an `a' in
    pattern matches either `a' or `A'  in file; likewise, an `A' in pattern
    matches either `a' or `A'.

-l  Print the  name of each file containing matching  lines rather than the
    lines.

-n  The line number in the file accompanies each line printed.

-s  Suppress all output, just return status.

-v  Print a line if the pattern is not found in the line.

-x  Print the  line only if  it is exactly  the same as  the pattern; treat
    wildcards in the pattern as plain text.

-y  Lower-case letters in  pattern match only upper-case letters within the
    input lines.

Limits

The COHERENT implementation of grep  sets the following limits on input and
output:

     Characters per input record        512
     Characters per output record       512
     Characters per field               512

See Also

cgrep,
commands,
ed,
egrep,
zgrep

Diagnostics

grep returns  an exit status of  zero for success, one  for no matches, two
for error.

Notes

cgrep  is  a  version  of  grep  that is  optimized  for  handling  C-style
expressions.

egrep is an extended and faster version of grep.