Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: clone an associative array?
- X-seq: zsh-workers 21674
- From: Peter Stephenson <pws@xxxxxxx>
- To: zsh-workers <zsh-workers@xxxxxxxxxx>
- Subject: Re: clone an associative array?
- Date: Fri, 19 Aug 2005 15:30:37 +0100
- In-reply-to: <21138.1124461492@xxxxxxx>
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
- References: <20050819141338.GA5747@xxxxxxxxxxxxxxxxxxxxxxx> <21138.1124461492@xxxxxxx>
Peter Stephenson wrote:
> > % typeset -A counterfeit
> > % counterfeit=${homemade}
>
> As it's a sort of array, you need braces.
I meant parentheses, of course. You've already got the braces.
> typeset -A counterfeit
> counterfeit=(${(kv)homemade})
>
> Make sure you don't have the option SH_WORD_SPLIT set. (This is a
> classic example of why it's a good idea to get used to doing without it.)
This is what Stephane's version works around.
pws
**********************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.
**********************************************************************
Messages sorted by:
Reverse Date,
Date,
Thread,
Author