On 7/11/24 8:40 PM, Robert Elz wrote:
Further, if "localness" is considered an attribute of a variable (which
isn't how I would implement it, but assuming it is) then surely declare
should have an option to set the local attribute,
It doesn't need one; using declare in a shell function is suff
Date:Thu, 11 Jul 2024 16:01:20 -0400
From:Chet Ramey
Message-ID: <2739cbbc-d44e-423e-869e-f2884c148...@case.edu>
| The bug in bash-4.2 was that [...]
| This would have been clearer to see (and more misleading) if the variable
| x also had a value at the global
On 7/11/24 9:42 AM, Dr. Werner Fink wrote:
Hi,
I've a report that with later bash the following which works in bash-4.2
x () {
local x=y
declare -p x
echo $x
unset x
declare -p x
echo $x
}
with
linux-40cm:~ # x () {
> local x=y
> declare -p x
> echo $x
>
On Thu, Jul 11, 2024 at 15:39:41 -0400, Lawrence Velázquez wrote:
> I won't speculate about the issue, but your subject goes too far.
> The variable really is unset here:
>
> % cat /tmp/x.bash
> x() {
> local x=y
> declare -p x
> echo "x is ${x
On Thu, Jul 11, 2024, at 9:42 AM, Dr. Werner Fink wrote:
> I've a report that with later bash the following which works in bash-4.2
>
> [...]
>
> linux-40cm:~ # x () {
> > local x=y
> > declare -p x
> > echo $x
> > unset x
> > declare -p x
> > echo $x
> > }
> linux-40cm:~ # x
On Thu, Jul 11, 2024, 16:34 alex xmb sw ratchev wrote:
>
>
> On Thu, Jul 11, 2024, 15:42 Dr. Werner Fink wrote:
>
>> Hi,
>>
>> I've a report that with later bash the following which works in bash-4.2
>>
>> x () {
>> local x=y
>> declare -p x
>> echo $x
>> unset x
>> declare -p x
>>
On Thu, Jul 11, 2024, 15:42 Dr. Werner Fink wrote:
> Hi,
>
> I've a report that with later bash the following which works in bash-4.2
>
> x () {
> local x=y
> declare -p x
> echo $x
> unset x
> declare -p x
> echo $x
> }
>
> with
>
> linux-40cm:~ # x () {
> > local x=y
> > de