summary refs log tree commit diff
path: root/bin/cash/tests/builtins/local3.0
blob: 3f78640812331502557538539b54114b48bd5188 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# $FreeBSD: releng/12.0/bin/sh/tests/builtins/local3.0 251797 2013-06-15 22:22:03Z jilles $

f() {
	local "$@"
	set -a
	x=7
	case $- in
	*a*) : ;;
	*) echo In-function \$- bad
	esac
	[ "$x" = 7 ] || echo In-function \$x bad
}
x=1
case $- in
*a*) echo Initial \$- bad
esac
f x -
case $- in
*a*) echo Intermediate \$- bad
esac
[ "$x" = 1 ] || echo Intermediate \$x bad
f - x
case $- in
*a*) echo Final \$- bad
esac
[ "$x" = 1 ] || echo Final \$x bad