xref: /freebsd/bin/sh/tests/builtins/local3.0 (revision 783d3ff6d7fae619db8a7990b8a6387de0c677b5)
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