gnu.bash.bug
[Top] [All Lists]

Re: Variable scoping

Subject: Re: Variable scoping
From: Stephane Chazelas <Stephane_Chazelas@xxxxxxxx>
Date: Sun, 27 Jul 2008 22:35:32 +0100
Newsgroups: gnu.bash.bug

On Fri, Jul 25, 2008 at 08:58:21AM +0300, Pierre Gaston wrote:
[...]
> With  "sh" (a posix shell) no
> In bash you can use the builtin "local" (or declare).
[...]

See http://stchaz.free.fr/locvar.sh for one way to implement
local scope in a POSIX script.

(those functions have not been thoroughly tested, they were just
written as a proof of concept, but you get the idea).

-- 
Stéphane



<Prev in Thread] Current Thread [Next in Thread>