Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: `jobs' builtin does not work with pipe in scripts



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