Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 158259 - local array unset prevents assignment (see result 3, below)
Summary: local array unset prevents assignment (see result 3, below)
Alias: None
Product: Fedora
Classification: Fedora
Component: bash
Version: 1
Hardware: i686
OS: Linux
Target Milestone: ---
Assignee: Tim Waugh
QA Contact: Ben Levenson
Depends On:
TreeView+ depends on / blocked
Reported: 2005-05-20 00:02 UTC by Shannon
Modified: 2007-11-30 22:11 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2005-05-20 08:25:14 UTC

Attachments (Terms of Use)

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):

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 08:25:14 UTC
Works fine in Fedora Core 3.

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

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