Bug 158259 - local array unset prevents assignment (see result 3, below)
local array unset prevents assignment (see result 3, below)
Product: Fedora
Classification: Fedora
Component: bash (Show other bugs)
i686 Linux
medium Severity medium
: ---
: ---
Assigned To: Tim Waugh
Ben Levenson
Depends On:
  Show dependency treegraph
Reported: 2005-05-19 20:02 EDT by Shannon
Modified: 2007-11-30 17:11 EST (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2005-05-20 04:25:14 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Shannon 2005-05-19 20:02:15 EDT
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):

How reproducible:

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



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

Expected Results:  1: a b c
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 04:25:14 EDT
Works fine in Fedora Core 3.
Comment 2 Shannon 2005-05-20 13:43:01 EDT
Thanks Tim!

Note You need to log in before you can comment on or make changes to this bug.