From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10791 invoked from network); 30 May 2002 13:28:30 -0000 Received: from sunsite.dk (130.225.247.90) by ns1.primenet.com.au with SMTP; 30 May 2002 13:28:30 -0000 Received: (qmail 21212 invoked by alias); 30 May 2002 13:28:06 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 5015 Received: (qmail 21199 invoked from network); 30 May 2002 13:28:05 -0000 Date: Thu, 30 May 2002 15:25:15 +0200 From: Thomas =?iso-8859-1?Q?K=F6hler?= To: zsh-users@sunsite.dk Subject: Re: $jobstates (Re: zsh: Strange feature with 'jobs' commmand) Message-ID: <20020530132514.GA6724@picard.franken.de> Mail-Followup-To: zsh-users@sunsite.dk References: <20020530135450.A16761@licia.dtek.chalmers.se> <20020530123310.GA5771@picard.franken.de> <15606.8100.523967.430265@wischnow.berkom.de> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="W/nzBZO5zC0uMSeA" Content-Disposition: inline In-Reply-To: <15606.8100.523967.430265@wischnow.berkom.de> User-Agent: Mutt/1.3.28i X-Operating-System: Linux picard 2.4.18 X-Editor: VIM - Vi IMproved 6.1 http://www.vim.org/ X-IRC: tirc; Nick: jeanluc X-URL: http://jeanluc-picard.de/ --W/nzBZO5zC0uMSeA Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: attachment Content-Transfer-Encoding: quoted-printable Sven Wischnowsky wrote [020530 14:49]: > Thomas K=F6hler wrote: >=20 > > ... > > What I don't understand from "man zshparam": [...] > > Why doesn't > > ~> echo $jobstates[(K)*] > > return anything when [...] >=20 > You want (i): >=20 > % echo $jobstates[(i)*] > 1 2 ... >=20 > With k and K the *keys* stored in the assoc (as opposed to the *exp* > given in the subscript) are used as patterns: >=20 > % 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 Aaaaahh, silly me. Now I understand :-) Now, for the original problem... Uhm. Tricky. any better ideas? jless() { typeset -x -A tmpstates for i in $jobstates[(I)*]=20 do tmpstates[$i]=3D$jobstates[$i] done for i in $tmpstates[(I)*] do echo "[$i]\t$tmpstates[$i]" done | sort -n | less unset tmpstates } Ciao, Thomas --=20 Thomas K=F6hler Email: jean-luc@picard.franken.de | LCARS - Linux <>< WWW: http://jeanluc-picard.de | for Computers IRC: jeanluc | on All Real PGP public key available from Homepage! | Starships --W/nzBZO5zC0uMSeA Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.6 (GNU/Linux) Comment: For info see http://www.gnupg.org iD8DBQE89ig6TEYXWMJlHuYRAg77AKCi+8w01VpdTIEVXCwwd/xOOxvbywCeI/+6 2R7hF+5fQudR1KGQpX8a8n0= =bzw5 -----END PGP SIGNATURE----- --W/nzBZO5zC0uMSeA--