--- 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.
> 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.
_______________________________________________________
Linux-HA-Dev: [email protected]
http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev
Home Page: http://linux-ha.org/