On Mon, Nov 19, 2018 at 2:27 PM Christian Meesters <[email protected]> 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
