builtin

kill

Send a signal to a known process. Use only owned live children or self in these labs; group signaling has broader effects. TERM may be handled, KILL cannot be trapped.

Formal Syntax & Structure

bash syntaxbash
kill -s signal pid

Parameters & Attributes

NameTypeDescription
signalsignal nameSignal to deliver.
pidpositive PIDKnown target process.

Return Value

exit status

Send a signal to a known process. Use only owned live children or self in these labs; group signaling has broader effects. TERM may be handled, KILL cannot be trapped.

Working Example

Example Snippetbash
bash -c 'trap "exit 7" TERM; kill -TERM "$BASHPID"; exit 1'printf 'status=%s\n' "$?"
Bash Reference