bug-bash
[Top][All Lists]
Advanced

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

Re: zsh style associative array assignment bug


From: Oğuz
Subject: Re: zsh style associative array assignment bug
Date: Sun, 28 Mar 2021 07:25:50 +0300

28 Mart 2021 Pazar tarihinde Eric Cook <llua@gmx.com> yazdı:

> Hey,
>
> When doing an assignment with an uneven number of elements bash currently
> silently treat the last element
> as a key and assigns it an empty string.
>
> $ typeset -A ary=(this feature came from zsh); typeset -p ary
> declare -A ary=([came]="from" [this]="feature" [zsh]="" )
>
> In zsh this is an error,
> % typeset -A ary=(this feature came from zsh); typeset -p ary
> zsh: bad set of key/value pairs for associative array
>
> Could bash be adjusted to align with zsh in this case?


Why? I think it's better this way.


-- 
Oğuz


reply via email to

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