On Fri, 12 Nov 2010, wucan wrote:

On 11/12/2010 06:09 AM, Thomas Dickey wrote:
On Thu, 11 Nov 2010, Gaetan Nadon wrote:

According to "man sh" on my Debian distro:

That's probably the bash manpage, since you're quoting from it.

s/bash/dash/

fwiw, man bash gives

       local [option] [name[=value] ...]
              For  each  argument, a local variable named name is created, and
              assigned value.  The option can be any of the  options  accepted
              by declare.  When local is used within a function, it causes the
              variable name to have a visible scope restricted to  that  func-
              tion and its children.  With no operands, local writes a list of
              local variables to the standard output.  It is an error  to  use
              local when not within a function.  The return status is 0 unless
              local is used outside a function, an invalid name  is  supplied,
              or name is a readonly variable.

...
BUGS
...
       There are some subtle differences between bash and traditional versions
       of sh, mostly because of the POSIX specification.

man dash gives

     Variables may be declared to be local to a function by using a local com-
     mand.  This should appear as the first statement of a function, and the
     syntax is

           local [variable | -] ...

     Local is implemented as a builtin command.

...

HISTORY
     dash is a POSIX-compliant implementation of /bin/sh that aims to be as
     small as possible.  dash is a direct descendant of the NetBSD version of
     ash (the Almquist SHell), ported to Linux in early 1997.  It was renamed
     to dash in 2002.


(neither identifies it as an extension, and dash is supposed to use fewer extensions, making scripts based on it more portable).


--
Thomas E. Dickey
http://invisible-island.net
ftp://invisible-island.net
_______________________________________________
[email protected]: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel

Reply via email to