]> git.saurik.com Git - apple/shell_cmds.git/blob - sh/tests/builtins/local3.0
f1d135d0b9253e5206139339ee07bfc3fd375d4c
[apple/shell_cmds.git] / sh / tests / builtins / local3.0
1 # $FreeBSD: head/bin/sh/tests/builtins/local3.0 251797 2013-06-15 22:22:03Z jilles $
2
3 f() {
4 local "$@"
5 set -a
6 x=7
7 case $- in
8 *a*) : ;;
9 *) echo In-function \$- bad
10 esac
11 [ "$x" = 7 ] || echo In-function \$x bad
12 }
13 x=1
14 case $- in
15 *a*) echo Initial \$- bad
16 esac
17 f x -
18 case $- in
19 *a*) echo Intermediate \$- bad
20 esac
21 [ "$x" = 1 ] || echo Intermediate \$x bad
22 f - x
23 case $- in
24 *a*) echo Final \$- bad
25 esac
26 [ "$x" = 1 ] || echo Final \$x bad