Subject: bin/6764: `trap 0' does not work in ksh subshells
To: None <gnats-bugs@gnats.netbsd.org>
From: Charles M. Hannum <root@ihack.net>
List: netbsd-bugs
Date: 01/07/1999 21:25:09
>Number:         6764
>Category:       bin
>Synopsis:       `trap 0' does not work in ksh subshells
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    bin-bug-people (Utility Bug People)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Jan  7 18:35:01 1999
>Last-Modified:
>Originator:     Charles M. Hannum
>Organization:
	dis
>Release:        1.3I and earlier
>Environment:
System: NetBSD zygorthian-space-raiders.mit.edu 1.3H NetBSD 1.3H (ZYGORTHIAN-SPACE-RAIDERS) #5: Sun Nov 8 20:58:49 EST 1998 mycroft@zygorthian-space-raiders.mit.edu:/u2/src/sys/arch/i386/compile/ZYGORTHIAN-SPACE-RAIDERS i386


>Description:

	`trap foo 0' is supposed to execute `foo' when the shell
	exits.  This works correctly with subshells in /bin/sh but not
	in /bin/ksh.  This is a serious compatibility problem with the
	original Korn shell.

>How-To-Repeat:

	The following script should output `win'.  It doesn't.

	#!/bin/ksh
	(trap 'echo win' 0)

>Fix:

	Not analyzed.

>Audit-Trail:
>Unformatted: