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    c...@case.edu    http://cnswww.cns.cwru.edu/~chet/

Reply via email to