Re: Looping Shell Scripts and System Load
On Wed, Jun 24, 2020 at 12:19:30PM -0500, Martin McCormick wrote:
> I wrote a shell script that unzips documents and I originally
> wrote it such that it gets document #1, unzips it then gets
> document #2, etc and it does that just fine so I wondered if I
> could make it run faster by starting several processes at once,
> each one unzipping a file. It's certainly still running and will
> eventually finish but I created a monster because it starts as
> many processes as there are items to unzip.
>
I recommend you look at the parallel package. It is specifically geared
toward parallelization of constructed shell command lines. Think
something along the lines of "find .... -exec ...." but with the ability
to parallelize (in a way that considers the available CPU cores on your
system).
Regards,
-Roberto
--
Roberto C. Sánchez
Reply to: