2005-11-01 Stepan Kasal * doc/autoconf.texi (Limitations of Builtins): Document that "trap - SIG" is not yet portable. Index: doc/autoconf.texi =================================================================== RCS file: /cvsroot/autoconf/autoconf/doc/autoconf.texi,v retrieving revision 1.932 diff -u -r1.932 autoconf.texi --- doc/autoconf.texi 21 Oct 2005 05:46:50 -0000 1.932 +++ doc/autoconf.texi 1 Nov 2005 08:46:24 -0000 @@ -11365,7 +11365,7 @@ RISC/OS} 4.52 refuses to do it. Don't use @samp{shift 2} etc.; it was not in the 7th Edition Bourne shell, -and it is also absent in many pre-POSIX shells. +and it is also absent in many pre-Posix shells. @item @command{source} @@ -11488,6 +11488,27 @@ It is safe to trap at least the signals 1, 2, 13, and 15. You can also 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). + +But even though Posix defines that the trap can be unset by address@hidden - SIG}, the feature is not widely supported yet. +But it si safe to use @samp{trap '' SIG} to ignore the signal; in particular, address@hidden '' 0} is a portable way to clear the trap 0. + address@hidden +The above is based on report: + +From: Kean Johnston +Date: Mon, 31 Oct 2005 23:53:23 -0800 +Cc: address@hidden, address@hidden, address@hidden +Message-ID: + +[trap - 0 doesn't work on] SCO OpenServer 5, SCO OpenServer 6, SCO UnixWare 2, +SCO UnixWare 7. But I took a look around ... +http://docs.sun.com/app/docs/doc/816-5165/6mbb0m9sa?a=view#indexterm-694 +(Solaris 10 man page for sh) doesn't support trap - either, but +it does support the null string as an argument. Same with HPUX 11 +(http://docs.hp.com/en/B2355-90680/sh-bourne.1.html). address@hidden ignore 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