bug-bash
[Top][All Lists]
Advanced

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

Re: [bash 4.2] `declare -g' bug?


From: Clark J. Wang
Subject: Re: [bash 4.2] `declare -g' bug?
Date: Fri, 18 Feb 2011 11:25:48 +0800

On Fri, Feb 18, 2011 at 8:45 AM, Chet Ramey <address@hidden> wrote:

>
> The -g option exists solely to create variables at the global scope.  The
> intent is that functions be able to declare global variables with
> attributes if they desire.  It doesn't change the scoping rules or
> variable resolution behavior.
>
>
A global var can always be declared out of a func (usually at the beginning
of the script) so what's the main intention of introducing a new `-g'
option?

And If we can declare/modify a global var in a func but we cannot read it
from in the func I don't think the feature is very useful to people.


> 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/
>



-- 
``... And it's a bash bug. I don't understand why bash people can't accept
that.'' - Linus Torvalds


reply via email to

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