summaryrefslogtreecommitdiffstats
path: root/bin/sh/sh.1
diff options
context:
space:
mode:
authorbdrewery <bdrewery@FreeBSD.org>2015-04-18 23:49:57 +0000
committerbdrewery <bdrewery@FreeBSD.org>2015-04-18 23:49:57 +0000
commit5ae6ee36a954c208f9859b1596737b5e75fbef3f (patch)
tree9ce9623e515c474ad35bc9eb956e5841ab94f157 /bin/sh/sh.1
parentbcb929d8e83e31f96e4ae6b2b578c5f1eb738c8a (diff)
downloadFreeBSD-src-5ae6ee36a954c208f9859b1596737b5e75fbef3f.zip
FreeBSD-src-5ae6ee36a954c208f9859b1596737b5e75fbef3f.tar.gz
sh: Fix the trap builtin to be POSIX-compliant for 'trap exit SIG' and 'trap n n...'.
The parser considered 'trap exit INT' to reset the default for both EXIT and INT. This beahvior is not POSIX compliant. This was avoided if a value was specified for 'exit', but then disallows exiting with the signal received. A possible workaround is using ' exit'. However POSIX does allow this type of behavior if the parameters are all integers. Fix the handling for this and clarify its support in the manpage since it is specifically allowed by POSIX. Differential Revision: https://reviews.freebsd.org/D2325 Reviewed by: jilles MFC after: 2 weeks
Diffstat (limited to 'bin/sh/sh.1')
-rw-r--r--bin/sh/sh.15
1 files changed, 2 insertions, 3 deletions
diff --git a/bin/sh/sh.1 b/bin/sh/sh.1
index b22a98f..e5707c0 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 February 22, 2015
+.Dd April 18, 2015
.Dt SH 1
.Os
.Sh NAME
@@ -2574,8 +2574,7 @@ 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.
+and using only signal numbers is another way to request the default action.
In a subshell or utility environment,
the shell resets trapped (but not ignored) signals to the default action.
The
OpenPOWER on IntegriCloud