dg_kill(1) DG/UX 5.4.2 dg_kill(1)
NAME
dgkill - test for or terminate a process
SYNOPSIS
dgkill [ -lnp ] [ -signo | -signame ] [ -- ] name | PID ...
DESCRIPTION
Dgkill tests for the existence of the specified processes and,
optionally, sends a specified signal to those processes. Sending a
signal will normally kill processes that do not catch or ignore the
signal.
A process can be selected by specifying its simple filename, name, or
its process number. The name is the command name by which the
process was invoked with any leading directory components omitted.
Regular expressions, as used with ed(1), may be used in the name.
All regular expression patterns are anchored as if specified with a
leading ``^'' and followed by a ``$''.
The process number, PID, of each asynchronous process started with &
is reported by the shell unless more than one process is started in a
pipeline. If more than one process is started in a pipeline, the
number of the last process in the pipeline is reported. Process
numbers can also be found by using ps(1).
If a negative process number is specified, all processes in the
process group to which the positive process number belongs will be
signalled. If process number 0 is specified, all processes in the
current process group are signalled. The signalled process must
belong to the current user unless he or she is the superuser. See
kill(2) for more information.
If a signal number, signo, or signal name, signame, preceded by - is
given, that signal is sent to the process. (see signal(2) or
/usr/include/sys/signal.h). Signal number 9 (as in dgkill -9 ...)
is a sure kill. Signal names may include or omit the leading
``SIG''. Use the -l option to obtain a list of acceptable names.
If no signal number or signal number 0 is specified, no signal will
be sent and dgkill will merely test to see if the any of the
selected processes are running. The exit code will indicate whether
any are or not.
Options
-l List all signal numbers and names, and then exit.
-n Invert the exit code, effectively testing for ``is not
running'' instead of ``is running''. dgkill will exit
with a zero exit code if none of the specified processes
are running, or if there was any error. A non-zero exit
code will result if any of the specified processes are
running.
-p Print the PID and command name for all processes found to
Licensed material--property of copyright holder(s) 1
dg_kill(1) DG/UX 5.4.2 dg_kill(1)
be running. This option is ignored when specifying
processes by process number.
-sig The number or name of the signal to be sent to all selected
processes.
EXAMPLES
$ if dgkill lpsched
> then
> echo lpsched is running
> fi
In this example, dgkill is used to determine if a command by the
name of lpsched is running.
$ dgkill -SIGTERM 'rpc..*'
In this example, the dgkill command is used to terminate all
processes with names matching the regular expression pattern
``rpc..*''. Note the use of quotes to avoid shell interpretation of
special characters.
EXIT CODES
The following are the normal exit values:
0 At least one process that matched the selection criteria was
found to be running.
1 No running processes match the selection criteria.
2 An error occurred obtaining process information.
3 There was a syntax error in the command line.
When the -n option is used, the non-zero exit codes are replaced by
zero and 1 is returned if any process was found to be running.
No message is displayed when a specified process number or name does
not match a running process. The exit code is the only indication
given.
SEE ALSO
csh(1), ed(1), kill(1), ps(1), sh(1).
kill(2), signal(2).
NOTES
Unlike kill(1), dgkill does not signal selected processes unless a
signal number is supplied.
Use care when specifying process names, especially when using regular
expression patterns, because other users may be running commands with
names similar to the names you are trying to select. Note that
regular expression patterns are not the same as shell wildcard
characters.
Licensed material--property of copyright holder(s) 2