Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: fg jobs info
- X-seq: zsh-users 11812
- From: Matthew Wozniski <godlygeek@xxxxxxxxx>
- To: zsh-users@xxxxxxxxxx
- Subject: Re: fg jobs info
- Date: Wed, 5 Sep 2007 07:34:23 -0400
- 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=
- In-reply-to: <20070905112141.GA4519@xxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <20070902154306.35880.qmail@xxxxxxxxxxx> <070902105953.ZM22915@xxxxxxxxxxxxxxxxxxxxxx> <20070903163147.GA14017@mastermind> <20070904111631.81486.qmail@xxxxxxxxxxx> <070904083104.ZM25598@xxxxxxxxxxxxxxxxxxxxxx> <20070905090302.72429.qmail@xxxxxxxxxxx> <200709050928.l859Su9h016042@xxxxxxxxxxxxxx> <20070905112141.GA4519@xxxxxxx>
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
Messages sorted by:
Reverse Date,
Date,
Thread,
Author