trap 0 in /bin/sh

Ronald S H Khoo ronald at robobar.co.uk
Thu Mar 28 01:33:52 AEST 1991


Can someone explain why these two commands give different output ?
Is there some subtlety about the "trap" command that I don't understand ?

	$ ( trap 'echo foo' 0 ; true )
	$ ( trap 'echo foo' 0 ; : )
	foo

I tried this using /bin/sh on SCO Xenix, SCO Unix (orig release) and
GEC UX/63 (SVR2, I think) and SunOS 4.1.  Yes, I know they're all System V
/bin/sh, but I don't have a BSD handy to try.

-- 
Ronald Khoo <ronald at robobar.co.uk> +44 81 991 1142 (O) +44 71 229 7741 (H)



More information about the Comp.unix.sysv386 mailing list