From owner-freebsd-doc@FreeBSD.ORG Mon Aug 30 16:17:22 2004 Return-Path: Delivered-To: freebsd-doc@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 1555816A4CE; Mon, 30 Aug 2004 16:17:22 +0000 (GMT) Received: from mailhost.stack.nl (vaak.stack.nl [131.155.140.140]) by mx1.FreeBSD.org (Postfix) with ESMTP id 818FF43D39; Mon, 30 Aug 2004 16:17:21 +0000 (GMT) (envelope-from jilles@stack.nl) Received: from snail.stack.nl (snail.stack.nl [IPv6:2001:610:1108:5010::131]) by mailhost.stack.nl (Postfix) with ESMTP id 7DD1E1F062; Mon, 30 Aug 2004 18:17:20 +0200 (CEST) Received: by snail.stack.nl (Postfix, from userid 1677) id 6C72C2287B; Mon, 30 Aug 2004 18:17:20 +0200 (CEST) Date: Mon, 30 Aug 2004 18:17:20 +0200 From: Jilles Tjoelker To: "Simon L. Nielsen" Message-ID: <20040830161720.GC17909@stack.nl> References: <200408261254.i7QCsA4P092588@freefall.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200408261254.i7QCsA4P092588@freefall.freebsd.org> X-Operating-System: FreeBSD 5.2.1-RELEASE-p9 i386 User-Agent: Mutt/1.5.6i cc: freebsd-doc@FreeBSD.org cc: freebsd-standards@FreeBSD.org Subject: Re: docs/70985: [patch] sh(1): incomplete documentation of 'trap' builtin X-BeenThere: freebsd-doc@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Documentation project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Aug 2004 16:17:22 -0000 On Thu, Aug 26, 2004 at 12:54:10PM +0000, Simon L. Nielsen wrote: > Synopsis: [patch] sh(1): incomplete documentation of 'trap' builtin > > Responsible-Changed-From-To: freebsd-doc->freebsd-standards > Responsible-Changed-By: simon > Responsible-Changed-When: Thu Aug 26 12:50:29 GMT 2004 > Responsible-Changed-Why: > Over to the standards people so they can decide if we want to document > that our shell is not fully standard complaint (according the to the > PR - I haven't checked further) or if our sh should rather be changed. > If the standards people think it should be documented, as described in > the PR, feel free to throw this PR back to freebsd-doc. > http://www.freebsd.org/cgi/query-pr.cgi?pr=70985 Documenting the POSIX way trap - action... seems good. The non-compliancy in the PR is using trap with two or more actions to reset the signal to default. For example "trap INT TERM" should set the action for SIGTERM to "INT" but instead resets both SIGINT and SIGTERM to default. The results from invoking trap with a single argument (excluding options) are undefined in POSIX. A small comparison with other shells: bash changed that from 2.x to 3.x -- bash2 bahaves as FreeBSD sh here, while bash3 is POSIX-compliant here (but allows resetting a signal to default with a single argument, like "trap USR1"). zsh (4.2.0) and pdksh (5.2.14p2) behave as FreeBSD sh. ksh93 behaves according to POSIX. -- Jilles Tjoelker