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 pidParameters & Attributes
| Name | Type | Description |
|---|---|---|
| signal | signal name | Signal to deliver. |
| pid | positive PID | Known 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' "$?"