On 6/18/16 7:59 PM, Linda Walsh wrote:

> Grisha Levit wrote:
>> The manual references these values being set, not just declared, so maybe
>> should check for invisible_p?
> ---
> Why?  I.e. what were you wanting to happen?

Think it through.  A variable is not set until it has been assigned a
value.  Giving a variable an attribute (in this case, the `local'
attribute) without assigning a value means that the variable is still
unset.  For example,

export X
echo ${X:+set}
printenv X

will display nothing.  So the two examples Grisha gave print the same
thing, though the documentation says that POSIXLY_CORRECT and IGNOREEOF
have an effect only when set (though IGNOREEOF is more vague, and talks
about `no value', by which it means the null string).

Grisha's question is whether or not the variables need to be set before
having side effects.  I tend to agree with him.

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