DASH Shell discussions
 help / color / mirror / Atom feed
From: Harald van Dijk <harald@gigawatt.nl>
To: Martijn Dekker <martijn@inlv.org>, dash@vger.kernel.org
Subject: Re: [BUG] 'trap' is not quite POSIX compliant
Date: Sat, 13 Feb 2016 17:08:05 +0100	[thread overview]
Message-ID: <56BF54E5.7020006@gigawatt.nl> (raw)
In-Reply-To: <56BF4F91.7080105@inlv.org>

On 13/02/2016 16:45, Martijn Dekker wrote:
> The 'trap' command in dash is not compliant with POSIX. According to the
> spec, both '-' and any unsigned decimal integer should be accepted as an
> argument meaning 'unset this trap'; dash only accepts '-'.

Indeed. This was reported early December at
<http://www.spinics.net/lists/dash/msg01109.html> along with a patch. 
The patch got rejected in its initial form, which would treat any 
unsigned decimal integer as a signal number. Its later update treats 
unsigned decimal integers as signal numbers only up to NSIG (which is an 
OS-dependent value). bash uses a dynamic limit based on NSIG too, except 
it adds some specific special numbers for bash-specific traps. I 
wouldn't be surprised if it's dynamic in the other shells you tested as 
well, and that the shell-specific traps are the reason for the slight 
variations in limits you found.

Cheers,
Harald van Dijk

  reply	other threads:[~2016-02-13 16:08 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-13 15:45 [BUG] 'trap' is not quite POSIX compliant Martijn Dekker
2016-02-13 16:08 ` Harald van Dijk [this message]
2016-02-15 18:46 ` Chet Ramey

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=56BF54E5.7020006@gigawatt.nl \
    --to=harald@gigawatt.nl \
    --cc=dash@vger.kernel.org \
    --cc=martijn@inlv.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox