Post by konsoleboxI'm more interested to know why `declare` was made to declare
variables in the local context by default, when there's already the
`local` builtin.
Your history is backwards. `declare' predated `local', which only came
in just before 1990 in response to a late draft (D9?) of Posix.2-1992.
Since declare already had the desired semantics, it was easy to add local.
Post by konsoleboxWas it because it was meant to remain compatible with
`typeset`? And even if `local` was added later (if it was added
later), I think it was still early enough for `declare` to be able to
change behavior. We could have enjoyed global declaration of
associative arrays as early as 4.0.
All of this happened before 1990, and there wasn't any inclination to
make bash incompatible with ksh.
--
``The lyf so short, the craft so long to lerne.'' - Chaucer
``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU ***@case.edu http://cnswww.cns.cwru.edu/~chet/