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?

1 Answer 1

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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .