From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10195 invoked from network); 30 May 2002 12:39:39 -0000 Received: from sunsite.dk (130.225.247.90) by ns1.primenet.com.au with SMTP; 30 May 2002 12:39:39 -0000 Received: (qmail 8474 invoked by alias); 30 May 2002 12:39:27 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 5013 Received: (qmail 8462 invoked from network); 30 May 2002 12:39:26 -0000 Date: Thu, 30 May 2002 14:33:10 +0200 From: Thomas =?iso-8859-1?Q?K=F6hler?= To: zsh-users@sunsite.dk Subject: $jobstates (Re: zsh: Strange feature with 'jobs' commmand) Message-ID: <20020530123310.GA5771@picard.franken.de> Mail-Followup-To: zsh-users@sunsite.dk References: <20020530135450.A16761@licia.dtek.chalmers.se> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="XsQoSWH+UP9D9v3l" Content-Disposition: inline In-Reply-To: <20020530135450.A16761@licia.dtek.chalmers.se> 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/ --XsQoSWH+UP9D9v3l Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi, Bj=F6rn Johannesson wrote [020530 14:12]: > Hi. >=20 > If you start a few jobs in the background and do: > zsh% jobs > [1] - running xmixer > [2] + running gtcd > zsh% _ >=20 > ok, this is expected but this is not... > zsh% jobs | less > (END) > zsh% _ >=20 > Why? This is quite annoying. You do not get any output if you pipe the > results from the "jobs" command. (jobs 2>&1|less doesn't work either) I don't remember exactly why this is the case (you might find something in the archives), but you can get the information via the $jobstates associative array. echo $jobstates | less What I don't understand from "man zshparam": 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'. 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'. Why doesn't ~> echo $jobstates[(K)*] return anything when ~> echo $jobstates[*] running::6179=3Drunning running:-:6193=3Drunning running:+:6207=3Drunning returns a few jobs? ~> echo $jobstates[1] running::6179=3Drunning also works fine. I would suppose ~> echo $jobstates[(K)*] 1 2 3 or something similar... 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 --XsQoSWH+UP9D9v3l 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 iD8DBQE89hwGTEYXWMJlHuYRAk2eAJ90+6vYia/7w5RB3fRwVf8Uu212vQCcDszc +wJlh1H7UfL2fJaBl2fWNxo= =qwfJ -----END PGP SIGNATURE----- --XsQoSWH+UP9D9v3l--