bug-bash
[Top][All Lists]
Advanced

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

Re: inconsistency with "readonly" and scope


From: Linda Walsh
Subject: Re: inconsistency with "readonly" and scope
Date: Fri, 13 Apr 2012 17:50:10 -0700
User-agent: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.8.1.24) Gecko/20100228 Lightning/0.9 Thunderbird/2.0.0.24 Mnenhy/0.7.6.666



Chet Ramey wrote:

This is intended.  Bash doesn't allow a local copy of a variable to
override a readonly global one.  This can be a potential security hole,

---
You can look at it that way, but it also hinders modular programming.

If I declare a variable to be local, I wouldn't expect it to fail and
be overridden by some global namespace pollution.

It is overridable, but not easily.

Might be nice to have some way to declare a var local to a function that
can be protected from random namespace pollution.





reply via email to

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