[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Portability problems in autoconf manual
From: |
Mike Frysinger |
Subject: |
Re: Portability problems in autoconf manual |
Date: |
Wed, 29 Apr 2009 16:04:39 -0400 |
User-agent: |
KMail/1.11.2 (Linux/2.6.29.1; KDE/4.2.2; x86_64; ; ) |
On Wednesday 29 April 2009 15:47:19 Paul Eggert wrote:
> > It seems that 'trap 1 2 13 15' (without any command) reset the traps
> > in a reasonably portable way,
>
> I'm afraid not. For example, on Ubuntu 9.04:
>
> $ dash
> !-penguin $ trap 1 2
> !-penguin $ kill -2 $$
> dash: 1: not found
>
> It's hard to argue that this is a bug, since POSIX requires this behavior.
that looks like a bug in dash according to the POSIX documentation
http://www.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#trap
If the first operand is an unsigned decimal integer, the shell shall treat all
operands as conditions, and shall reset each condition to the default value.
Otherwise, if there are operands, the first is treated as an action and the
remaining as conditions.
thus `trap 1 2` should reset signals 1 and 2 to the default handler since the
first arg "1" is an unsigned decimal integer.
-mike
signature.asc
Description: This is a digitally signed message part.