bug-bash
[Top][All Lists]
Advanced

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

Re: read-only flag is lost for functions in sub shells


From: Chet Ramey
Subject: Re: read-only flag is lost for functions in sub shells
Date: Thu, 31 Jul 2014 09:06:12 -0400
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:24.0) Gecko/20100101 Thunderbird/24.6.0

On 7/30/14, 6:11 PM, Linda Walsh wrote:
> If I assigned the read-only bit to an exported var and run a new
> shell, that var is still read-only.

No:

$ ./bash ./x24
4.2.47(4)-release
foo = one
foo = two
$ cat ./x24
echo $BASH_VERSION

foo=one
readonly foo
export foo

./bash -c 'echo foo = $foo ; foo=two ; echo foo = $foo'

-- 
``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]