-
Notifications
You must be signed in to change notification settings - Fork 4
/
pgrep.3p
executable file
·100 lines (100 loc) · 2.44 KB
/
pgrep.3p
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
.TH PGREP 3P "10 April 1983"
.UC 4
.SH NAME
pgrep \- search files for a pattern
.SH SYNOPSIS
.B pgrep
[\fB\-eilmnw\fR] [\fB\-f \fRmakefile] [\fB\-C \fRcommand] [\fB\-F \fRpatfile]
[pattern [file ...]]
.SH DESCRIPTION
.I Pgrep
searchs through specified files for lines matching
.I pattern.
Normally, each line found is printed to standard output. Alternatively,
.I command
can be executed, with arguments that are the names of files containing
.I pattern.
.PP
The names of files can be specified as arguments, or obtained from the `HDRS'
and `SRCS' macro definitions in a makefile (\fB\-m \fRoption),
or a combination of both. When
.I pgrep
is told to use a makefile and the
.B \-f
option is not present, the files `makefile' and `Makefile' are tried in
order.
.PP
.I Pgrep
uses the
.I grep
or
.I egrep
commands to search for the pattern.
.I Grep
patterns are limited to regular expressions in the style of \fIex\fR(1).
.I Egrep
patterns are full regular expressions.
Care should be taken when using the characters $ * [ | ( ) and \\ in
.I pattern
as they are also meaningful to the command shell. It is safest to enclose
the entire
.I pattern
in single quotes.
.SH OPTIONS
.IP \fB\-e\fR
Use
.I egrep
instead of
.I grep.
.IP "\fB\-f \fImakefile\fR"
Specify an alternative
.I makefile
file name. This option also implies the
.B \-m
option.
.IP \fB\-i\fR
Ignore case of letters when making comparisons (i.e. upper and lower case
are considered identical).
.I Grep
only.
.IP \fB\-l\fR
List the names of files with matching lines. The file names are printed
one per line.
.IP \fB\-m\fR
Obtain the names of files to search from a makefile. If no
.B \-f
option is present, the makefiles `makefile' and `Makefile' are tried in order.
.IP \fB\-n\fR
Precede each matching line by its relative line number in the file.
.IP \fB\-w\fR
Treat
.I pattern
as a word (i.e. as if surrounded by `\\<' and `\\>'; see \fIex\fR(1)\|).
.I Grep
only.
.IP "\fB\-C \fIcommand\fR"
Execute
.I command
with arguments that are
the names of files containing
.I pattern.
.IP "\fB\-F \fIpatfile\fR"
The regular expression is taken from
.I patfile.
.I Egrep
only.
.SH FILES
.ta \w'/usr/new/lib/pgrep'u+.5i
/usr/new/lib/pgrep Pgrep program.
.br
makefile Default makefile.
.br
Makefile Alternative default makefile.
.DT
.SH "SEE ALSO"
egrep(1), ex(1), grep(1), make(1), mkmf(1P), pgrep(1P), vi(1)
.SH DIAGNOSTICS
Exit status is 0 if any matches are found, 1 if none,
2 for syntax errors or inaccessible files.
.SH AUTHOR
Peter J. Nicklin