#!/bin/bash njob=1 nJOB=30 while read line do name=`echo $line | awk -F '/' '{print $NF}' | awk -F '.' '{print $1}'` echo $name if [ $njob -lt $nJOB ]; then njob=$[ njob + 1 ] else njob=0 wait fi done<$1