Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
clone an associative array?
- X-seq: zsh-workers 21671
- From: Marc Chantreux <marc.chantreux@xxxxxxxxxxxxxxxxxx>
- To: zsh-workers <zsh-workers@xxxxxxxxxx>
- Subject: clone an associative array?
- Date: Fri, 19 Aug 2005 16:13:38 +0200
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
hello all,
i don't know what i missed in 'parameters expansions' manual but i'm
unable to clone an associative array :
% typeset -A homemade
% homemade=( tm myself c 2005 )
% echo $homemade[tm]
myself
% typeset -A counterfeit
% counterfeit=${homemade}
% echo $counterfeit[c]
m
% counterfeit="${homemade}"
% echo $counterfeit[c]
m
% counterfeit="${(AA)homemade}"
% echo $counterfeit[c]
m
% counterfeit="${(A)homemade}"
% echo $counterfeit[c]
m
# other tries failed too ...
in a future time, i would like to write something as :
func () {
local who=$1
shift
local -A config
config=$@
# implementation here ....
}
i'm sure that it is possible, i just want to know how.
regards
mc
Messages sorted by:
Reverse Date,
Date,
Thread,
Author