xref: /freebsd/bin/sh/tests/builtins/local3.0 (revision 7fdf597e96a02165cfe22ff357b857d5fa15ed8a)
1
2f() {
3	local "$@"
4	set -a
5	x=7
6	case $- in
7	*a*) : ;;
8	*) echo In-function \$- bad
9	esac
10	[ "$x" = 7 ] || echo In-function \$x bad
11}
12x=1
13case $- in
14*a*) echo Initial \$- bad
15esac
16f x -
17case $- in
18*a*) echo Intermediate \$- bad
19esac
20[ "$x" = 1 ] || echo Intermediate \$x bad
21f - x
22case $- in
23*a*) echo Final \$- bad
24esac
25[ "$x" = 1 ] || echo Final \$x bad
26