Bug 158259

Summary: local array unset prevents assignment (see result 3, below)
Product: [Fedora] Fedora Reporter: Shannon <re391c>
Component: bashAssignee: Tim Waugh <twaugh>
Status: CLOSED CURRENTRELEASE QA Contact: Ben Levenson <benl>
Severity: medium Docs Contact:
Priority: medium    
Version: 1   
Target Milestone: ---   
Target Release: ---   
Hardware: i686   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2005-05-20 08:25:14 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Shannon 2005-05-20 00:02:15 UTC
From Bugzilla Helper:
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322)

Description of problem:
"unset" against an array with local scope makes the array unusable until issuing inline "local"

Assume this also effects current releases since I didn't see any bug reports, quick verification anyone?


Version-Release number of selected component (if applicable):
bash-2.05b-31

How reproducible:
Always

Steps to Reproduce:
1. paste this into bash:

function testLocalUnset () {

local -a testArray
testArray=(a b c)
echo 1: ${testArray[@]}
# result: 1: a b c

unset testArray
echo 2: ${testArray[@]}
# result: 2:

testArray=(a b c)
echo 3: ${testArray[@]}
# result: 3:

local -a testArray
testArray=(a b c)
echo 4: ${testArray[@]}
# result: 4: a b c

}

testLocalUnset



Actual Results:  1: a b c
2:
3:
4: a b c


Expected Results:  1: a b c
2: 
3: a b c
4: a b c

Additional info:

Setting normal severity rather than low just because it is in a venerable tool.

Comment 1 Tim Waugh 2005-05-20 08:25:14 UTC
Works fine in Fedora Core 3.

Comment 2 Shannon 2005-05-20 17:43:01 UTC
Thanks Tim!