summaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorstefanf <stefanf@FreeBSD.org>2005-12-08 21:18:59 +0000
committerstefanf <stefanf@FreeBSD.org>2005-12-08 21:18:59 +0000
commit88baff4d5fa6fa89fa89c5c78bb50bfb4d8d8d19 (patch)
tree3c5231e3951b4af01342f595b4a26e90ef20c2f0 /bin
parent0dcfd185aff80e3d2e75ab6f9c203126f3311c1b (diff)
downloadFreeBSD-src-88baff4d5fa6fa89fa89c5c78bb50bfb4d8d8d19.zip
FreeBSD-src-88baff4d5fa6fa89fa89c5c78bb50bfb4d8d8d19.tar.gz
- Document trap's -l option and the behaviour of a missing action or a single
dash. - Discourage the omission of the action. PR: 70985 [1] Submitted by: Martin Kammerhofer
Diffstat (limited to 'bin')
-rw-r--r--bin/sh/sh.116
1 files changed, 14 insertions, 2 deletions
diff --git a/bin/sh/sh.1 b/bin/sh/sh.1
index df6b626b..6fa59ed 100644
--- a/bin/sh/sh.1
+++ b/bin/sh/sh.1
@@ -32,7 +32,7 @@
.\" from: @(#)sh.1 8.6 (Berkeley) 5/4/95
.\" $FreeBSD$
.\"
-.Dd December 4, 2005
+.Dd December 8, 2005
.Dt SH 1
.Os
.Sh NAME
@@ -1957,6 +1957,7 @@ The first output line shows the user and system times for the shell
itself, the second one contains the user and system times for the
children.
.It Ic trap Oo Ar action Oc Ar signal ...
+.It Ic trap Fl l
Cause the shell to parse and execute
.Ar action
when any specified
@@ -1968,14 +1969,25 @@ In addition, the pseudo-signal
may be used to specify an action that is performed when the shell terminates.
The
.Ar action
-may be null or omitted;
+may be an empty string or a dash
+.Pq Ar - ;
the former causes the specified signal to be ignored
and the latter causes the default action to be taken.
+Omitting the
+.Ar action
+is another way to request the default action, for compatibility reasons this
+usage is not recommended though.
When the shell forks off a subshell,
it resets trapped (but not ignored) signals to the default action.
The
.Ic trap
command has no effect on signals that were ignored on entry to the shell.
+.Pp
+Option
+.Fl l
+causes the
+.Ic trap
+command to display a list of valid signal names.
.It Ic type Op Ar name ...
Interpret each
.Ar name
OpenPOWER on IntegriCloud