From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13148 invoked from network); 26 Mar 2005 22:33:15 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 26 Mar 2005 22:33:15 -0000 Received: (qmail 37101 invoked from network); 26 Mar 2005 22:33:09 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 26 Mar 2005 22:33:09 -0000 Received: (qmail 19121 invoked by alias); 26 Mar 2005 22:33:01 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 8634 Received: (qmail 19109 invoked from network); 26 Mar 2005 22:33:00 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 26 Mar 2005 22:33:00 -0000 Received: (qmail 36018 invoked from network); 26 Mar 2005 22:33:00 -0000 Received: from morda.newmail.ru (HELO flock1.newmail.ru) (212.48.140.150) by a.mx.sunsite.dk with SMTP; 26 Mar 2005 22:32:57 -0000 Received: (qmail 27698 invoked from network); 26 Mar 2005 22:15:09 -0000 Received: from unknown (HELO ?10.0.0.1?) (arvidjaar@newmail.ru@83.237.195.78) by smtpd.newmail.ru with SMTP; 26 Mar 2005 22:15:09 -0000 From: Andrey Borzenkov To: zsh-users@sunsite.dk Subject: Re: array contains "foo" Date: Sun, 27 Mar 2005 01:32:54 +0300 User-Agent: KMail/1.7.2 Cc: Dave Yost References: In-Reply-To: Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200503270132.55621.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,UPPERCASE_25_50 autolearn=no version=3.0.2 X-Spam-Hits: -2.6 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 [Redirected to zsh-users] On Saturday 26 March 2005 23:53, Dave Yost wrote: > Hi. > > I've beat my head against the zsh manual for an hour now, and I can't > see how to test whether > > x=(foo bar) > > contains foo (yes) or contains xyz (no). > {pts/1}% x=(foo bar) {pts/1}% echo ${${x[(r)foo]}:+yes} yes {pts/1}% echo ${${x[(r)xyz]}:-no} no - -andrey -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.0 (GNU/Linux) iD8DBQFCReMXR6LMutpd94wRAvujAJ0YV/OKpI6/qbtVQ3mkJBGfr3x+lwCgwy0J j0QcqPMA84ZkKhk7ZEb1p/w= =EJVK -----END PGP SIGNATURE-----