#!/bin/bash thread=10 count=30 for x in `seq 1 $thread $count`;do { for y in `seq 0 $((thread-1))`;do { echo $((x+y)); sleep 1; }& done; wait; } done; 效果