[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: inconsistency with "readonly" and scope
From: |
Chet Ramey |
Subject: |
Re: inconsistency with "readonly" and scope |
Date: |
Thu, 12 Apr 2012 08:33:43 -0400 |
User-agent: |
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:10.0.2) Gecko/20120216 Thunderbird/10.0.2 |
On 4/11/12 2:50 PM, Greg Wooledge wrote:
> "declare" when used in a function acts like "local", and creates a variable
> with scope local to that function. So does "declare -r". But "readonly",
> which is otherwise the same as "declare -r", creates variables with global
> scope.
>
> Is this intended?
Yes. `readonly' is part of Posix, and behaves as Posix specifies.
`declare' is not, and can do what it likes.
Chet
--
``The lyf so short, the craft so long to lerne.'' - Chaucer
``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, ITS, CWRU chet@case.edu http://cnswww.cns.cwru.edu/~chet/
- Re: inconsistency with "readonly" and scope, (continued)
- Re: inconsistency with "readonly" and scope, Chet Ramey, 2012/04/12
- Re: inconsistency with "readonly" and scope, Linda Walsh, 2012/04/13
- Re: inconsistency with "readonly" and scope, Chet Ramey, 2012/04/14
- Re: inconsistency with "readonly" and scope, Maarten Billemont, 2012/04/15
- Re: inconsistency with "readonly" and scope, Andreas Schwab, 2012/04/15
- Re: inconsistency with "readonly" and scope, Linda Walsh, 2012/04/15
Re: inconsistency with "readonly" and scope,
Chet Ramey <=