If anybody is willing to try this small library of sh functions and report the
performance penalty of using these to declare local variables vs not using
these functions and managing global only variables ?
Recursivity tests would be nice too.
Supposedly, SysVr4 sh is at least 10x faster than bash.
I would do these myself but I have a pair of toothy jaws just breathing down my
neck reminding me to meet some very, VERY pressing deadlines.
Newsgroups: gnu.bash.bug
From: Stephane Chazelas <[EMAIL PROTECTED]>
Date: Sun, 27 Jul 2008 22:35:32 +0100
Local: Sun, Jul 27 2008 5:35 pm
Subject: Re: Variable scoping
Reply | Reply to author | Forward | Print | View thread | Show original |
Report this message | Find messages by this author
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
_______________________________________________________
Linux-HA-Dev: [email protected]
http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev
Home Page: http://linux-ha.org/