[Top][All Lists]

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

Re: Inconsistent behaviour of +=() and existing array keys

From: helmut . karlowski
Subject: Re: Inconsistent behaviour of +=() and existing array keys
Date: Sat, 29 Nov 2014 19:19:37 -0000
User-agent: Opera Mail/12.16 (Win32)

On Fri, Nov 28, 2014 at 03:47:49PM -0500, Maarten Billemont wrote:
least for the associative arrays case, because in the case of normal arrays,
ksh93 does some pretty funny things:

| dualbus@hp ~ % ksh93 -c 'a=(); a+=([0]=b); typeset -p a'
| typeset -A a=([0]=b) # Ha! Now 'a' is an associative array...

Associative is more "default" in ksh93 as in bash:

typeset -p a

gives in bash:
declare -a a='([0]="4")'

in ksh93:
typeset -A a=([0]=4)

An empty array (a=()) gives in ksh93:
typeset -C a=()

-C means Compound variable, which is something different.


Erstellt mit Operas revolutionärem E-Mail-Modul: http://www.opera.com/mail/

reply via email to

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