From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10235 invoked from network); 30 May 2002 12:48:48 -0000 Received: from sunsite.dk (130.225.247.90) by ns1.primenet.com.au with SMTP; 30 May 2002 12:48:48 -0000 Received: (qmail 11010 invoked by alias); 30 May 2002 12:48:27 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 5014 Received: (qmail 10997 invoked from network); 30 May 2002 12:48:26 -0000 From: Sven Wischnowsky MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Message-ID: <15606.8100.523967.430265@wischnow.berkom.de> Date: Thu, 30 May 2002 14:48:36 +0200 To: zsh-users@sunsite.dk Subject: Re: $jobstates (Re: zsh: Strange feature with 'jobs' commmand) In-Reply-To: <20020530123310.GA5771@picard.franken.de> References: <20020530135450.A16761@licia.dtek.chalmers.se> <20020530123310.GA5771@picard.franken.de> X-Mailer: VM 7.03 under 21.5 (patch 5) "beets" XEmacs Lucid Thomas K=F6hler wrote: > ... >=20 > What I don't understand from "man zshparam": >=20 > k If used in a subscript on an associative array, > this flag causes the keys to be interpreted as pat=AD > terns, and returns the value for the first key > found where exp is matched by the key. This flag > does not work on the left side of an assignment to > an associative array element. If used on another > type of parameter, this behaves like `r'. >=20 > K On an associative array this is like `k' but > returns all values where exp is matched by the > keys. On other types of parameters this has the > same effect as `R'. >=20 > Why doesn't > ~> echo $jobstates[(K)*] > return anything when [...] You want (i): % echo $jobstates[(i)*] 1 2 ... With k and K the *keys* stored in the assoc (as opposed to the *exp* given in the subscript) are used as patterns: % typeset -A type % type=3D('[a-zA-Z]' alpha '[0-9]' digit '[^a-zA-Z0-9]' other) % echo $type[(k)x] $type[(k)4] $type[(k).] alpha digit other Bye Sven --=20 Sven Wischnowsky wischnow@berkom.de