parallel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: dealing with exhausted list of work items


From: Ole Tange
Subject: Re: dealing with exhausted list of work items
Date: Wed, 21 Nov 2018 22:51:55 +0100

On Mon, Nov 19, 2018 at 2:27 PM Christian Meesters
<address@hidden> wrote:

> is it possible to let parallel trigger a command once the number of
> work-items is exhausted?

Use a wrapper that is triggered when it hits a magical value:

$ doit() { if [ "$1" = "done" ] ; then echo last command read; else
sleep 1; echo do stuff $1; fi }
$ parallel -j2 doit ::: 1 2 3 done
do stuff 1
do stuff 2
last command read
do stuff 3


/Ole



reply via email to

[Prev in Thread] Current Thread [Next in Thread]