From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19702 invoked from network); 5 Sep 2007 11:34:56 -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:34:56 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 27478 invoked from network); 5 Sep 2007 11:34:50 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 5 Sep 2007 11:34:50 -0000 Received: (qmail 14601 invoked by alias); 5 Sep 2007 11:34:40 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 11812 Received: (qmail 14589 invoked from network); 5 Sep 2007 11:34:39 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 5 Sep 2007 11:34:39 -0000 Received: (qmail 26203 invoked from network); 5 Sep 2007 11:34:39 -0000 Received: from an-out-0708.google.com (209.85.132.247) by a.mx.sunsite.dk with SMTP; 5 Sep 2007 11:34:32 -0000 Received: by an-out-0708.google.com with SMTP id c14so486595anc for ; Wed, 05 Sep 2007 04:34:32 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:received:date:from:to:subject:message-id:references:mime-version:content-type:content-disposition:in-reply-to:user-agent; b=cFt4WhDkZR6TmPn+GBwTcDUB/x/oqtGIgeiXEP1ibPKENnsb5WnDYw7+LdF9sgysKstXmf24rixGbwKvPM2Ih/LmFjinkCl1pAk1iONGoiByW17EiFJVduqITohuCusMIO7i0SfBWdndCbeCin7K2tQPsFnl5YeKJxtLtigJfBc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:date:from:to:subject:message-id:references:mime-version:content-type:content-disposition:in-reply-to:user-agent; b=XBJoiMH8YGKRCYYrJ+QHhkdKdANApAJCmeBy2Mh9bMHqHbA3RmGQBVyBrIK02zNkxFAE667QyR1oGFQIcaYpukqoJYx8prMghpPUzWreBl1hBbakZUV0O0//kb+JQppaq1C+txBGwaQ06OirPOhHcS9TiHqctjnOs/ERH3np6RU= Received: by 10.100.110.16 with SMTP id i16mr4662784anc.1188992071911; Wed, 05 Sep 2007 04:34:31 -0700 (PDT) Received: from mastermind ( [76.99.60.158]) by mx.google.com with ESMTPS id b11sm7713730ana.2007.09.05.04.34.28 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 05 Sep 2007 04:34:30 -0700 (PDT) Received: by mastermind (sSMTP sendmail emulation); Wed, 05 Sep 2007 07:34:23 -0400 Date: Wed, 5 Sep 2007 07:34:23 -0400 From: Matthew Wozniski To: zsh-users@sunsite.dk Subject: Re: fg jobs info Message-ID: <20070905113422.GA26710@mastermind> 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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20070905112141.GA4519@miek.nl> User-Agent: Mutt/1.5.15+20070412 (2007-04-11) 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. > $jobstates includes a lot, but not the actual job number. Sure it does. $jobstates, and $jobtexts for that matter, is an associative array, not a traditionally indexed array. So, you can just use ${(k)jobtexts} to find the current job numbers: 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 ~Matt