Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: `jobs' builtin does not work with pipe in scripts
- X-seq: zsh-workers 28454
- From: ZyX <zyx.vim@xxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: Re: `jobs' builtin does not work with pipe in scripts
- Date: Fri, 26 Nov 2010 07:38:12 +0300
- 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=
- In-reply-to: <1290728868-sup-9190@nixos>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <201011252341.44512@-zyx> <201011260040.34189@-zyx> <1290728868-sup-9190@nixos>
- Reply-to: zyx.vim@xxxxxxxxx
Reply to message ÂRe: `jobs' builtin does not work with pipe in scriptsÂ,
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
>
> /bin/sh -c 'sleep 1s & sleep 1s & jobs | cat ' | while read .. ?
>
> Anyway you seem to have found something which works for you.
What more? `jobs -p | ...' is not working, I do not want to rewrite everything
in POSIX shell and I can't use interactive shell. `jobs -p | ...' is used in a
script that launches parallel processes and, when zsh catches CHLD, looks which
of them finished. You can see it here: http://vimpluginloader.hg.sourceforge.net/hgweb/vimpluginloader/dev-tools/file/tip/parjobs.zsh.
I do not like `ps --ppid $$' solution because it launches additional process,
but it works.
Attachment:
signature.asc
Description: This is a digitally signed message part.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author