From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22611 invoked from network); 5 Oct 2002 19:52:55 -0000 Received: from sunsite.dk (130.225.247.90) by ns1.primenet.com.au with SMTP; 5 Oct 2002 19:52:55 -0000 Received: (qmail 23398 invoked by alias); 5 Oct 2002 19:52:45 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 17774 Received: (qmail 23382 invoked from network); 5 Oct 2002 19:52:43 -0000 From: "Bart Schaefer" Message-Id: <1021005195209.ZM5915@candle.brasslantern.com> Date: Sat, 5 Oct 2002 19:52:09 +0000 In-Reply-To: <20021005173125.GA24695@dman.com> Comments: In reply to Clint Adams "[doogie@debian.org: Bug#163391: unset array[key] where key is non-existent doesn't fail]" (Oct 5, 1:31pm) References: <20021005173125.GA24695@dman.com> X-Mailer: Z-Mail (5.0.0 30July97) To: Clint Adams , zsh-workers@sunsite.dk Subject: Re: [doogie@debian.org: Bug#163391: unset array[key] where key is non-existent doesn't fail] Cc: 163391-forwarded@bugs.debian.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii On Oct 5, 1:31pm, Clint Adams wrote: } } I'm not sure to what "contract" he's referring, but SUSv3 says } } Unsetting a variable or function that was not previously set shall not } be considered an error and does not cause the shell to abort. } } and that unset should return a >0 exit status if any of the "name" } operands cannot be unset. } } Of course, it knows nothing about associative arrays. Exactly. The variable "aarray" WAS previously set (by "declare -A"). The fact that a particular hash key was not assigned-to is irrelevant. zsh -c 'typeset non_existant_var; unset non_existant_var && echo consistent || echo inconsistent' -- Bart Schaefer Brass Lantern Enterprises http://www.well.com/user/barts http://www.brasslantern.com Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net