[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: gnulib/gnulib-tool shell quoting problem for Solaris /bin/sh

From: Paul Eggert
Subject: Re: gnulib/gnulib-tool shell quoting problem for Solaris /bin/sh
Date: Wed, 25 Jan 2006 14:15:05 -0800
User-agent: Gnus/5.1007 (Gnus v5.10.7) Emacs/21.4 (gnu/linux)

Bruno Haible <address@hidden> writes:

> Eric Blake wrote:
>> http://lists.gnu.org/archive/html/bug-autoconf/2005-11/msg00000.html
> It is regrettable that no doc was added to the autoconf manual about
> this pitfall.

Thanks for reminding me about this.  I just now installed this patch:

2006-01-25  Paul Eggert  <address@hidden>

        * doc/autoconf.texi (Limitations of Builtins): Document the
        problem with "trap -".

--- autoconf.texi.~1.942.~      2006-01-11 10:17:25.000000000 -0800
+++ autoconf.texi       2006-01-25 14:11:37.000000000 -0800
@@ -11531,6 +11531,13 @@ It is safe to trap at least the signals 
 trap 0, i.e., have the @command{trap} run when the script ends (either via an
 explicit @command{exit}, or the end of the script).
+Posix says that @samp{trap - 1 2 13 15} resets the traps for the
+specified signals to their default values, but many common shells (e.g.,
+Solaris @command{/bin/sh}) misinterpret this and attempt to execute a
+``command'' named @command{-} when the specified conditions arise.
+There is no portable workaround, except for @samp{trap - 0}, for which
address@hidden '' 0} is a portable substitute.
 Although Posix is not absolutely clear on this point, it is widely
 admitted that when entering the trap @samp{$?} should be set to the exit
 status of the last command run before the trap.  The ambiguity can be

reply via email to

[Prev in Thread] Current Thread [Next in Thread]