1# $FreeBSD: releng/11.0/bin/sh/tests/builtins/return4.0 208629 2010-05-28 22:08:34Z jilles $ 2 3failures= 4failure() { 5 echo "Error at line $1" >&2 6 failures=x$failures 7} 8 9T=$(mktemp -d ${TMPDIR:-/tmp}/sh-test.XXXXXX) || exit 10trap 'rm -rf $T' 0 11cd $T || exit 3 12echo 'return 42; exit 4' >testscript 13. ./testscript 14[ "$?" = 42 ] || failure $LINENO 15 16test -z "$failures" 17