bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: setarray[unsetkey] doesn't trigger nounset in arithmetic context


From: Chet Ramey
Subject: Re: setarray[unsetkey] doesn't trigger nounset in arithmetic context
Date: Mon, 22 May 2023 17:04:25 -0400
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.11.0

On 5/20/23 8:00 PM, Emanuele Torre wrote:
This was already reported 12 and a half years ago, but there have not
been many replies:

   https://lists.gnu.org/archive/html/bug-bash/2010-12/msg00128.html

It seems more natural, especially in the presence of sparse arrays, to
allow references to unset array elements in arithmetic contexts not to
abort the shell if nounset is enabled. ksh93 and mksh behave the same
way, even as they also treat references to unset array elements as fatal
errors when nounset is set.

--
``The lyf so short, the craft so long to lerne.'' - Chaucer
                 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU    chet@case.edu    http://tiswww.cwru.edu/~chet/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]