openbsd-ports/sysutils/proctools/patches/patch-pgrep_pgrep_1
2003-03-28 22:11:24 +00:00

90 lines
2.5 KiB
Plaintext

$OpenBSD: patch-pgrep_pgrep_1,v 1.2 2003/03/28 22:11:24 david Exp $
Document the -a and -V flags.
Document return values.
Added NOTES section.
--- pgrep/pgrep.1.orig Tue May 22 06:24:06 2001
+++ pgrep/pgrep.1 Mon Jan 6 23:07:30 2003
@@ -25,7 +25,7 @@
.\"OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
.\"USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
.\"
-.Dd May 21, 2001
+.Dd January 6, 2003
.Dt PGREP 1
.Os
.Sh NAME
@@ -33,7 +33,7 @@
.Nd find processes
.Sh SYNOPSIS
.Nm pgrep
-.Op Fl flnvx
+.Op Fl aflnvVx
.Op Fl d Ar delim
.Op Fl g Ar pgrplist
.Op Fl G Ar gidlist
@@ -64,6 +64,9 @@ prints information about all user-mode p
.Pp
The options are as follows:
.Bl -tag -width Ds
+.It Fl a
+Print the command-line arguments passed to the process along with the process ID
+(OpenBSD extension).
.It Fl d Ar delim
Use the specified delimiter to separate the process IDs instead of a newline.
.It Fl f
@@ -95,6 +98,13 @@ usernames and as numeric user IDs.
.It Fl v
Invert the matching algorithm to print information about process that do not
match the given arguments.
+.It Fl V
+Invert the matching algorithm to print information about process that do not
+match the given flags but DO match the given pattern. Has no effect if only
+a pattern is given (the pattern will be matched as normal). Overrides
+.Fl v
+if it is also given.
+(OpenBSD extension.)
.It Fl x
Make the pattern match be an exact match instead of a regular expression.
.El
@@ -111,6 +121,18 @@ Prints the process IDs of all processes
.Pp
Prints the process IDs of all shells whose effective user ID is root, separated
by commas.
+.Sh RETURN VALUES
+The
+.Nm
+utility exits with one of the following values:
+.Bl -tag -width Ds
+.It 0
+One or more processes were matched.
+.It 1
+No processes were matched.
+.It 64 (EX_USAGE)
+Invalid command-line options were specified.
+.El
.Sh SEE ALSO
.Xr pkill 1 ,
.Xr ps 1 ,
@@ -119,6 +141,12 @@ by commas.
The
.Nm
command first appeared in Sun Solaris 7.
+.Pp
+The
+.Fl a
+and
+.Fl V
+flags first appeared in the OpenBSD 3.3 ports tree.
.Sh BUGS
The original Solaris pgrep could also match against session ID, but OpenBSD's
session ID can fail to exist if the session leader exits.
@@ -128,4 +156,8 @@ Also, the original Solaris version had o
option to specify what signal to send. This version can also use the
.Fl s Ar signal
option, which subsumes the session ID match listed above.
+.Sh NOTES
+The current
+.Nm
+process will never consider itself a potential match.