On Wed, Aug 13, 2008 at 02:18:37AM -0700, Joe Bill wrote:
> 
> 
> 
> --- On Tue, 8/12/08, Simon Horman <[EMAIL PROTECTED]> wrote:
> 
> > Hi Joe,
> > 
> > I'm not sure if this is the correct specification, but
> > I've just taken a > quick look over the "Shell &
> > Utilities" volume of "IEEE Std 1003.1, 2004 Edition".
> > 
> > http://www.opengroup.org/austin/papers/posix_faq.html
> > -> http://www.unix.org/single_unix_specification/
> 
> The website is right. 

Ok great, I was concerned that somone had slipped something in my drink.

> > It seems to indicate that the for a function is:
> > 
> >        fname() compound-command[io-redirect ...]
> > 
> > It does not seem to make any mention of the function
> > keyword, which incidentally is not supported by dash,
> > the /bin/sh de jour of Debian and Ubuntu.
> 
> The 'function' keyword is ksh-93 specific.
> It's not posix compatible.
> 
> > As for local and typedef, neither seem to be mentioned in
> > the specification - though I'm prepared to accept that I
> > need to look harder.
> 
> Neither 'local', nor 'typeset' are posix.
>  
> > If we assume for a moment that they aren't part of the
> > specification, its probably best just to remove local
> > from our code.
> 
> See the post I forwarded, Subj: "variables scoping".
> 
> It contains a link to a library of shell scripts to use with a posix
> sh, and that allows the declaration of variables as local, and
> function call management functions that include the saving of a pseudo
> stack to simulate the behavior of local variables.

I think that is a nice approach, but I think that is is likely that we
can just get rid of local (I don't think it is used much) and save
ourselves the complexity of draging in that scoping code.

_______________________________________________________
Linux-HA-Dev: [email protected]
http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev
Home Page: http://linux-ha.org/

Reply via email to