parallelコマンド#!/bin/bash SEQ="A B C D E" echo "$SEQ" | parallel -j 10 \ 'echo -n NO.{#}: ; n=$(echo $(($RANDOM % 10))); sleep $n; echo -n " do sommething of {} "; echo .. done' NO.4: do sommething of D .. done NO.3: do sommething of C .. done NO.1: do sommething of A .. done NO.5: do sommething of E .. done NO.2: do sommething of B .. done 参考 |
|