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

zsh job control



Hello

I have rtfm and vast portions of the man page and not found the answer to
this... This is not a bug but may well be a wishlist item if it doesn't
exist already

What I am looking for is an integration of the control forms like while,
for, etc with job control.

For instance, to start 4 jobs decompressing with gzip, I might do

ls **/*.gz | xargs -n 1 -P 4 gunzip

but this doesn't work well when the command is more complicated

ls **/*.gz | xargs -n 1 -P 4 -iFILE zsh -c "zcat FILE | fgrep foobar" >
   results.txt

What I am hoping is that there is some sort of job control associated with
the standard zsh loops:

foreach[4] file (**/*.gz) 
do
  zcat $file | fgrep foobar
done > results.txt

or some such syntax. I recognize that I could simply background all the
processes but if I have hundreds of files, that creates hundreds of
processes- unworkable.

ideas?

---
frank@xxxxxxxxxxxxxx                                   Suum Cuique
"Who needs friends when you can sit alone in your room and drink?"



Messages sorted by: Reverse Date, Date, Thread, Author