sh: Add a simple test for the "local" builtin.

This commit is contained in:
Jilles Tjoelker 2012-07-15 10:22:13 +00:00
parent 84fbdd8ca0
commit fe36e227e8

View File

@ -0,0 +1,13 @@
# $FreeBSD$
# A commonly used but non-POSIX builtin.
f() {
local x
x=2
[ "$x" = 2 ]
}
x=1
f || exit 3
[ "$x" = 1 ] || exit 3
f || exit 3
[ "$x" = 1 ] || exit 3