#!/bin/bash

trap 'echo -n ""' SIGINT

count=20

if [ "x$1" != "x" ]; then
    count=$1
fi

i=17190
pids=""

while [ $count -ne 0 ]
do

    let "i  = i + 1"

    usleep 133

    ./grq $i > /dev/null 2>&1 &
    
    eval 'pids="$pids $!"'
    
    let "count = count - 1"
    
    echo $i : $count
done

echo $pids

trap "kill $pids" SIGINT

wait
