for ($c = 1; $c < 17; $c++) { if (fork() == 0) { exec ("CAD program with $c options...details not important"); exit; } wait; system ("sleep 20"); #so NFS gets updated...? if (-e "cmdos/$n[$c].done") { $complete = 1; #in other words: do nothing } else { die ("Dependency file $n[$c].done did not get created--exiting!\n"); } }