bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: add a way to declare global variables


From: Chet Ramey
Subject: Re: add a way to declare global variables
Date: Sat, 12 Dec 2009 12:37:54 -0500
User-agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.1.5) Gecko/20091204 Thunderbird/3.0

On 12/12/09 5:24 AM, Bernd Eggink wrote:

> It's the other way round. Regarding typeset and declare, the man page
> says: " When used in a function, makes  each name local, as with the
> local command. " So within a function, typeset, declare, and local are
> synonyms. Using 'local' outside a function is an error, so IMHO this
> command is completely redundant. It _would_ make some sense, however, if
> its counterpart 'global' existed, as it could help clarify the intended
> usage of the variable.

It might be considered redundant, but just consider it a more mnemonic
synonym for declare/typeset.  `local' appeared in an earlier version of
the Posix standard, though `typeset' never did.

Chet
-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
                 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, ITS, CWRU    address@hidden    http://cnswww.cns.cwru.edu/~chet/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]