bug-bash
[Top][All Lists]
Advanced

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

Re: Passing variables by reference conflicts with local


From: Chet Ramey
Subject: Re: Passing variables by reference conflicts with local
Date: Sun, 02 May 2010 14:37:53 -0400
User-agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.1.7) Gecko/20100111 Lightning/1.0b1 Thunderbird/3.0.1

On 5/1/10 6:19 PM, Freddy Vulto wrote:

> I have to give local variables a value (append an equal sign) in order
> to get them listed with 'local' in "blackbox()".  Is there a bash
> builtin which lists all defined local variable names, even those not
> having a value yet?

A variable that has not been assigned a value is not set.  After a
statement like `declare -r foo', bash keeps a placeholder so that if
foo will have the appropriate attributes if is is later assigned a value,
but such variables are not set, cannot be referenced, and should not be
listed by `set' or `declare'.

Chet

-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
                 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, ITS, CWRU    chet@case.edu    http://cnswww.cns.cwru.edu/~chet/




reply via email to

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