On 12.05.2020 07:34, Roland Illig wrote:
Module Name: pkgsrc Committed By: rillig Date: Tue May 12 05:34:04 UTC 2020 Modified Files: pkgsrc/regress/infra-unittests: subst.sh test.subr Log Message: regress/infra-unittests: clean up test code, add portability The test can now be run with bash and ksh as well. Bash exits if a function call returns failure, the NetBSD /bin/sh doesn't. After reading POSIX, sections "2.9.1 Simple Commands" and "set -e", I'm in favor of bash here.
That observation was wrong. The NetBSD /bin/sh also exits, as expected. The difference between /bin/sh and bash is that bash undoes any redirections before calling the trap handler, and neither the NetBSD /bin/sh nor /bin/ksh do that.