#!/bin/sh n=1 while [ $n -le $2 ]; do ping $1 > /dev/null 2>&1 & n=$(($n+1)) done wait