From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10914 invoked by alias); 26 Nov 2010 04:38:21 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 28454 Received: (qmail 15101 invoked from network); 26 Nov 2010 04:38:19 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE, T_TO_NO_BRKTS_FREEMAIL autolearn=ham version=3.3.1 Received-SPF: pass (ns1.primenet.com.au: SPF record at _spf.google.com designates 209.85.215.171 as permitted sender) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:reply-to:to:subject:date :user-agent:references:in-reply-to:mime-version:content-type :content-transfer-encoding:message-id; bh=PlpFFZbT+65ofeFD42txYizbLiNstHG5McVNu8yvOhI=; b=gC2r2XIu2gwj5FS1iU1oVN6u86xVTcZ7yuIg/sVQe73b65fDS1rXlP54BDtgXjGTo+ fjO4IcuKT7FgB0Ew9JOIjtMXIakvwJBqm4oDPB4I0aDMlzxCrIYDyHIcYa1uNv3dbckr IMCxsQ8Dh8j92y8fAjIAcQMUI7hMKyWoZ/vb8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:reply-to:to:subject:date:user-agent:references:in-reply-to :mime-version:content-type:content-transfer-encoding:message-id; b=IUCZORI5hzrP3ZkGHovuw+xOnsd0p76b3lt9AMRXzwYjCyEPQ8zqiiD1QzFC2w9o1y grUcCWJr9tKCGxoVYP3g9025hJp6XzaOWGT7qGM4fhrE9JX+1JrSQYuZM1BjMkFgDPM3 JLsefoJwG0wxIAqd6sPv+vVTaRlil61OZE5eg= From: ZyX Reply-To: zyx.vim@gmail.com To: zsh-workers@zsh.org Subject: Re: `jobs' builtin does not work with pipe in scripts Date: Fri, 26 Nov 2010 07:38:12 +0300 User-Agent: KMail/1.13.5 (Linux/2.6.34-zen1; KDE/4.4.5; x86_64; ; ) References: <201011252341.44512@-zyx> <201011260040.34189@-zyx> <1290728868-sup-9190@nixos> In-Reply-To: <1290728868-sup-9190@nixos> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart1509088.BVBQH6jS8d"; protocol="application/pgp-signature"; micalg=pgp-sha1 Content-Transfer-Encoding: 7bit Message-Id: <201011260738.12563@-zyx> --nextPart1509088.BVBQH6jS8d Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Reply to message =C2=ABRe: `jobs' builtin does not work with pipe in script= s=C2=BB,=20 sent 02:56:37 26 November 2010, Friday by Marc Weber: > I think you should provide more context. Its almost impossible to try to > find a workaround. Eg you could use /bin/sh >=20 > /bin/sh -c 'sleep 1s & sleep 1s & jobs | cat ' | while read .. ? >=20 > Anyway you seem to have found something which works for you. What more? `jobs -p | ...' is not working, I do not want to rewrite everyth= ing in POSIX shell and I can't use interactive shell. `jobs -p | ...' is used i= n a script that launches parallel processes and, when zsh catches CHLD, looks w= hich of them finished. You can see it here: http://vimpluginloader.hg.sourceforg= e.net/hgweb/vimpluginloader/dev-tools/file/tip/parjobs.zsh. I do not like `ps --ppid $$' solution because it launches additional proces= s, but it works. --nextPart1509088.BVBQH6jS8d Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part. -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.16 (GNU/Linux) iEYEABECAAYFAkzvObQACgkQkOgHluiXxU/8cQCeNlMELdk7By4aHRnNOEA0BT3i aEYAn1Pe10Zbt6gBpwBRfbQC9WILiExv =flzP -----END PGP SIGNATURE----- --nextPart1509088.BVBQH6jS8d--