#!/bin/bash rm h_b*.root rm l_b*.log tseed=$(($(date +%s%N)/1000000-1393400000000)) echo $tseed for i in {0..5}; do ./prt -o h_b$i.root -a 140 -l 1 -x "pi+" -p 3 -w 0 -g 1 -e 50 -b 1 -r $tseed$i > l_b$i.log & done sleep 1 while : do activth=$(ps aux | grep "[p]rt" | grep "h_b" | wc -l) diffth=$(($maxnthr-$activth)) echo "We have $activth active prt simulations " if [ "$activth" -eq 0 ]; then break fi sleep 2 done sleep 2 rm hits.root hadd hits.root h_b*.root