Parallel https://savannah.nongnu.org/projects/parallel/ does not pollute the output as much as xjobs and sends STDERR of the jobs to STDERR.
xjobs does not deal nicely with input having weird characters (such as “), whereas Parallel does.

====#!/bin/bash====
|
1 2 3 4 5 6 7 8 9 10 11 12 13 |
maxjobs=8 parallelize () { while [ $# -gt 0 ]; do count=(`jobs -p`) if [ ${#count[@]} -lt $maxjobs ]; then runstuff $1 & shift fi done wait } parallelize argv1 "argv2-1 argv2-2b" argv3 ... argvn |
====xargs vs xjobs====
There are also utilities already written just for this type of thing, but forget xargs. Check out
xjobs reads job descriptions line by line and executes them in parallel. It limits the number of parallel executing jobs and starts new jobs when jobs finish. If no utility is given as an argument to xjobs, then the first argument on every job line will be used as utility. xjobs support I/O redirection, which makes some applications possible that cannot be done with GNU’s xargs. xjobs also determines the number of processors automatically, whereas xargs must be told how many processes to start.
Parallel https://savannah.nongnu.org/projects/parallel/ does not pollute the output as much as xjobs and sends STDERR of the jobs to STDERR.
xjobs does not deal nicely with input having weird characters (such as “), whereas Parallel does.
Thanks for your information. I think it is useful for many clients.
Parallel https://savannah.nongnu.org/projects/parallel/ does not pollute the output as much as xjobs and sends STDERR of the jobs to STDERR.
xjobs does not deal nicely with input having weird characters (such as “), whereas Parallel does.
Thanks for your information. I think it is useful for many clients.