xref: /freebsd-src/bin/sh/tests/builtins/return5.0 (revision 2eb4d8dc723da3cf7d735a3226ae49da4c8c5dbc)
1# $FreeBSD$
2
3if [ "$1" != nested ]; then
4	f() {
5		set -- nested
6		. "$0"
7		# Allow return to return from the function or the dot script.
8		return 4
9	}
10	f
11	exit $(($? ^ 4))
12fi
13# To trigger the bug, the following commands must be at the top level,
14# with newlines in between.
15return 4
16echo bad
17exit 1
18