All pastes #395388 Raw Edit

Untitled

public text v1 · immutable
·published 2007-03-15 00:02 UTC
rendered paste body
# !/bin/bash

# how many cpu cores are in the machine?
CPU=`/bin/cat /proc/cpuinfo | /bin/grep proc | /bin/awk '{ print $3 }' | /usr/bi
n/tail -n 1`

CPU=$(($CPU + 1))

# run as many instances as there are cpu cores in the machine

for ((i=1; i <= CPU ; i++))
do
        echo "hi"  #do stuff here
done