From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 222 invoked from network); 3 Apr 2005 18:00:57 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 3 Apr 2005 18:00:57 -0000 Received: (qmail 6154 invoked from network); 3 Apr 2005 18:00:51 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 3 Apr 2005 18:00:51 -0000 Received: (qmail 25974 invoked by alias); 3 Apr 2005 18:00:48 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 21090 Received: (qmail 25945 invoked from network); 3 Apr 2005 18:00:47 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 3 Apr 2005 18:00:47 -0000 Received: (qmail 5874 invoked from network); 3 Apr 2005 18:00:47 -0000 Received: from morda.newmail.ru (HELO flock1.newmail.ru) (212.48.140.150) by a.mx.sunsite.dk with SMTP; 3 Apr 2005 18:00:43 -0000 Received: (qmail 22812 invoked from network); 3 Apr 2005 17:42:13 -0000 Received: from unknown (HELO ?10.0.0.1?) (arvidjaar@newmail.ru@83.237.106.140) by smtpd.newmail.ru with SMTP; 3 Apr 2005 17:42:13 -0000 From: Andrey Borzenkov To: zsh-workers@sunsite.dk Subject: Re: ${(kv)foo[bar]} Date: Sun, 3 Apr 2005 22:00:34 +0400 User-Agent: KMail/1.7.2 References: <200504031435.19457.arvidjaar@newmail.ru> <1050403174903.ZM4196@candle.brasslantern.com> In-Reply-To: <1050403174903.ZM4196@candle.brasslantern.com> Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200504032200.41605.arvidjaar@newmail.ru> X-Spam-Checker-Version: SpamAssassin 3.0.2 on a.mx.sunsite.dk X-Spam-Level: X-Spam-Status: No, score=-2.6 required=6.0 tests=AWL,BAYES_00 autolearn=ham version=3.0.2 X-Spam-Hits: -2.6 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Sunday 03 April 2005 21:49, Bart Schaefer wrote: > > Isn't that a rather silly way to do it in any case? You don't need the > subscript flags at all. Why not > > pkgs=( $(urpmq --list > --media ${opt_args[--media]} > --searchmedia ${opt_args[--searchmedia]} > 2> /dev/null > ) > because it breaks if no --media is given on command line. My example would have worked in both cases. > If for some reason you want to be deliberately obscure, you can force it > with: > > pkgs=( $(urpmq --list > ${(kv)opt_args[(i)--media]} > ${(kv)opt_args[(i)--searchmedia]} > 2> /dev/null > ) > OK, in my case it turned out I needed something more elaborate anyway but thank's for the idea, I'll keep it in mind :) Although it is rather hard to understand why ${(kv)opt_args[(i)--media]} should work and ${(kv)opt_args[--media]} not. - -andrey -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.0 (GNU/Linux) iD8DBQFCUC9JR6LMutpd94wRAimbAJ9bmX5OGhZAWmDgJREeHrkyFhuDNACdE7yU c2ROqzFKiCBtUa0aoJaKs9s= =EvN6 -----END PGP SIGNATURE-----