Running multiple commands in parallel and finish them with the shortest one

view story

http://stackoverflow.com – I am trying to run multiple benchmarks (B1 ....B10) in parallel and my intention is to end the execution of these benchmarks as soon as the first (shortest) benchmark's run get finished and immediately run a certain benchmark (BX). For running only two of them together, I have tried sorting the benchmarks based on their execution time in single run and have used the following command. However, with increasing the number of benchmarks and also unpredictability of their run time because of the resources they share, it is very hard to use it. Could you please let me know what can I do? Any shel (HowTos)