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
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=238469

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