From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24707 invoked from network); 5 Sep 2007 11:36:22 -0000 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00 autolearn=ham version=3.2.3 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 5 Sep 2007 11:36:22 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 31950 invoked from network); 5 Sep 2007 11:36:16 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 5 Sep 2007 11:36:16 -0000 Received: (qmail 15914 invoked by alias); 5 Sep 2007 11:36:09 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 11814 Received: (qmail 15904 invoked from network); 5 Sep 2007 11:36:09 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 5 Sep 2007 11:36:09 -0000 Received: (qmail 30680 invoked from network); 5 Sep 2007 11:36:09 -0000 Received: from sol.nlnetlabs.nl (213.154.224.43) by a.mx.sunsite.dk with SMTP; 5 Sep 2007 11:36:02 -0000 Received: from elektron.atoom.net (a80-127-17-126.adsl.xs4all.nl [80.127.17.126]) by sol.nlnetlabs.nl (Postfix) with ESMTP id 5EBE9188065 for ; Wed, 5 Sep 2007 13:36:02 +0200 (CEST) Received: by elektron.atoom.net (Postfix, from userid 1000) id 505CA3000862; Wed, 5 Sep 2007 13:36:02 +0200 (CEST) Date: Wed, 5 Sep 2007 13:36:02 +0200 From: Miek Gieben To: zsh-users@sunsite.dk Subject: Re: fg jobs info Message-ID: <20070905113602.GB4519@miek.nl> Mail-Followup-To: zsh-users@sunsite.dk References: <20070902154306.35880.qmail@smasher.org> <070902105953.ZM22915@torch.brasslantern.com> <20070903163147.GA14017@mastermind> <20070904111631.81486.qmail@smasher.org> <070904083104.ZM25598@torch.brasslantern.com> <20070905090302.72429.qmail@smasher.org> <200709050928.l859Su9h016042@news01.csr.com> <20070905112141.GA4519@miek.nl> <20070905113422.GA26710@mastermind> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="jq0ap7NbKX2Kqbes" Content-Disposition: inline In-Reply-To: <20070905113422.GA26710@mastermind> User-Agent: Vim/Mutt/Linux X-Home: www.miek.nl --jq0ap7NbKX2Kqbes Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable [On 05 Sep, @13:34, Matthew Wozniski wrote in "Re: fg jobs info ..."] > On Wed, Sep 05, 2007 at 01:21:41PM +0200, Miek Gieben wrote: > > Is there a way to get the jobnumber from any of these variables.=20 > > $jobstates includes a lot, but not the actual job number. >=20 > Sure it does. $jobstates, and $jobtexts for that matter, is an > associative array, not a traditionally indexed array. So, you can ah > just use ${(k)jobtexts} to find the current job numbers: >=20 > mastermind% sleep 50 & > [1] 26864 > mastermind% sleep 100 & > [2] 26865 > mastermind% sleep 20 & > [3] 26866 > mastermind% kill %2 > mastermind% > [2] - terminated sleep 100 > mastermind% echo ${(k)jobstates} > 1 3 Thank you, this makes it very easy indeeed. -- grtz, - Miek http://www.miek.nl PGP: 6A3C F450 6D4E 7C6B C23C F982 258B 85CF 3880 D0F6 --jq0ap7NbKX2Kqbes Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) iD8DBQFG3pSiJYuFzziA0PYRAuwHAJ4tgoMm6I6E5w8O5tTohdm5kJGWpwCgphbQ 5OmDMqu/LVEvJ0ckrhR8k3I= =Wgr7 -----END PGP SIGNATURE----- --jq0ap7NbKX2Kqbes--