ViewVC logotype

Contents of /code/tags/pcre-1.09/pgrep.1

Parent Directory Parent Directory | Revision Log Revision Log

Revision 22 - (hide annotations) (download)
Sat Feb 24 21:38:39 2007 UTC (8 years, 1 month ago) by nigel
File size: 2379 byte(s)
Tag code/trunk as code/tags/pcre-1.09.

1 nigel 3 .TH PGREP 1
2     .SH NAME
3     pgrep - a grep with Perl-compatible regular expressions.
5     .B pgrep [-chilnsvx] pattern [file] ...
9     \fBpgrep\fR searches files for character patterns, in the same way as other
10     grep commands do, but it uses the PCRE regular expression library to support
11     patterns that are compatible with the regular expressions of Perl 5. See
12     \fBpcre(3)\fR for a full description of syntax and semantics.
14     If no files are specified, \fBpgrep\fR reads the standard input. By default,
15     each line that matches the pattern is copied to the standard output, and if
16     there is more than one file, the file name is printed before each line of
17     output. However, there are options that can change how \fBpgrep\fR behaves.
19     Lines are limited to BUFSIZ characters. BUFSIZ is defined in \fB<stdio.h>\fR.
20     The newline character is removed from the end of each line before it is matched
21     against the pattern.
24     .SH OPTIONS
25     .TP 10
26     \fB-c\fR
27     Do not print individual lines; instead just print a count of the number of
28     lines that would otherwise have been printed. If several files are given, a
29     count is printed for each of them.
30     .TP
31     \fB-h\fR
32     Suppress printing of filenames when searching multiple files.
33     .TP
34     \fB-i\fR
35     Ignore upper/lower case distinctions during comparisons.
36     .TP
37     \fB-l\fR
38     Instead of printing lines from the files, just print the names of the files
39     containing lines that would have been printed. Each file name is printed
40     once, on a separate line.
41     .TP
42     \fB-n\fR
43     Precede each line by its line number in the file.
44     .TP
45     \fB-s\fR
46     Work silently, that is, display nothing except error messages.
47     The exit status indicates whether any matches were found.
48     .TP
49     \fB-v\fR
50     Invert the sense of the match, so that lines which do \fInot\fR match the
51     pattern are now the ones that are found.
52     .TP
53     \fB-x\fR
54     Force the pattern to be anchored (it must start matching at the beginning of
55     the line) and in addition, require it to match the entire line. This is
56     equivalent to having ^ and $ characters at the start and end of each
57     alternative branch in the regular expression.
60     .SH SEE ALSO
61     \fBpcre(3)\fR, Perl 5 documentation
65     Exit status is 0 if any matches were found, 1 if no matches were found, and 2
66     for syntax errors or inacessible files (even if matches were found).
69     .SH AUTHOR
70     Philip Hazel <ph10@cam.ac.uk>
71     .br
72 nigel 15 Copyright (c) 1998 University of Cambridge.

ViewVC Help
Powered by ViewVC 1.1.12