#!/bin/sh
if [ "$#" = 0 ]
then
	# no args given
	# generate IP addresses of local network to ping in parallel
	N=1
	while [ $N -lt 255 ]
	do
		echo 192.168.1.$N
		N=`expr $N + 1`
	done | parallel 50 $0
	exit
fi

for IP
do
	# do one ping (per IP), output successful responses
	ping -c 1 $IP | grep "bytes from"
done
