Date: Sun, 15 Jul 2012 10:22:14 +0000 (UTC) From: Jilles Tjoelker <jilles@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r238469 - head/tools/regression/bin/sh/builtins Message-ID: <201207151022.q6FAMEJL041244@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: jilles Date: Sun Jul 15 10:22:13 2012 New Revision: 238469 URL: http://svn.freebsd.org/changeset/base/238469 Log: sh: Add a simple test for the "local" builtin. Added: head/tools/regression/bin/sh/builtins/local1.0 (contents, props changed) Added: head/tools/regression/bin/sh/builtins/local1.0 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/bin/sh/builtins/local1.0 Sun Jul 15 10:22:13 2012 (r238469) @@ -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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201207151022.q6FAMEJL041244>