Eric Blake wrote:

In static scoping, function f2 does not shadow a declaration of a, so
references to $a within f2 refer to the global variable.  The local
variable a of f1 can only be accessed within f1; the behavior of f2 is
the same no matter how it was reached.

If it matters (I already know Chet's answer): I agree with Mr. Korn here about sanity. Infact, for some reason, I always intuitively relied on it (without any problem for now - I didn't hit a case), maybe I intuitively expected the C behaviour from Bash.

In Bash practise, now as I know it, I can code accordingly.

--
Be conservative in what you do, be liberal in what you accept from others.
- jbp, master of the net, in RFC793


Reply via email to