Subject: bin/6764: `trap 0' does not work in ksh subshells
To: None <>
From: Charles M. Hannum <>
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
>Originator:     Charles M. Hannum
>Release:        1.3I and earlier
System: NetBSD 1.3H NetBSD 1.3H (ZYGORTHIAN-SPACE-RAIDERS) #5: Sun Nov 8 20:58:49 EST 1998 i386


	`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.


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

	(trap 'echo win' 0)


	Not analyzed.