1

Im trying to use GNU parallel on a script, and i noticed that it only starts to output, after -jX X jobs

# Only spawns cat after 100 seconds
(echo a; sleep 100) | parallel -j1 --lb cat

# Starts instantly
(echo a; echo a; sleep 100) | parallel -j1 --lb cat

The first job needs to be launched before the others (because it would define the other jobs as parallel pipe the output to another script), but parallel is waiting for 3 more jobs

Is there a way to change this pattern?

0

Upgrade to 20181222 or later.

# Spawns a instantly
(echo a; sleep 100) | parallel -j1 --lb cat

# Starts a and b instantly, outputs a immediately, b after 100 sec
(echo a; echo b; sleep 100) | parallel -j1 --lb cat

# Starts a and b instantly, outputs a and b immediately (but output may be mixed)
(echo a; echo b; sleep 100) | parallel -j1 --lb cat
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.