Thanks,
it also works fine in GNU bash, version 4.3.42(4)-release (i686-pc-cygwin)
Sorry for troubbling you, I will upgrade my bash.
Regards -- Pontus



From:   Greg Wooledge <wool...@eeg.ccf.org>
To:     Chet Ramey <chet.ra...@case.edu>
Cc:     Pontus Stenström <pontus.stenst...@mycronic.com>, bug-bash@gnu.org
Date:   2016-02-15 15:47
Subject:        Re: Comma expression in arithmetic evaluation referring to 
arrays make bash crash.



On Mon, Feb 15, 2016 at 09:31:57AM -0500, Chet Ramey wrote:
> On 2/15/16 8:57 AM, Pontus Stenström wrote:
> 
> > Bash Version: 4.2
> > Patch Level: 24
> > Release Status: release
> > 
> > Description:
> >     Comma expression in arithmetic evaluation referring to arrays make 
bash
> > crash.
> > 
> > Repeat-By:
> >     This works fine:
> >     ((c=3, d=4))
> >     This crashes my bash:
> >     a=(2 3 4 5)        # OK
> >     ((c=a[3], d=a[2])) # Crash
> 
> It runs fine on bash-4.3.42 on RHEL 5 and Mac OS X.

On HP-UX, it doesn't crash, but doesn't work quite right either:

imadev:~$ bash-4.2 -c 'echo "$BASH_VERSION"; a=(2 3 4 5); ((c=a[3], 
d=a[2])); declare -p a c d'
4.2.46(1)-release
declare -a a='([0]="2" [1]="3" [2]="4" [3]="5")'
declare -- c="5"
bash-4.2: line 0: declare: d: not found

4.2 is the second-newest release, but 4.2.24 is 29 patches behind.
The current patch level for 4.2 is 4.2.53.  I'm apparently a bit behind
the current patch level as well.

It works in 4.3, as Chet said.





You are hereby formally notified that all information contained in this 
communication and any attachments shall be deemed strictly confidential 
and privileged unless explicitly stated otherwise. Please note that your 
use of confidential information may be governed, and restricted, by a 
non-disclosure agreement. The information contained in this communication 
and any attachments is disclosed for the sole use of the intended 
recipient(s). If you are not the intended recipient, you are hereby 
formally notified that any unauthorized review, use, disclosure or 
distribution of this message is prohibited. Please notify the sender 
immediately by replying to this message and destroy all copies of this 
message and any attachments. Mycronic is neither liable for the proper and 
complete transmission of the information contained in this communication, 
nor for any delay in its receipt.

Reply via email to