Skip to content

Instantly share code, notes, and snippets.

@everdark
Created May 17, 2014 01:47
Show Gist options
  • Save everdark/1a1f1d136514b814c833 to your computer and use it in GitHub Desktop.
Save everdark/1a1f1d136514b814c833 to your computer and use it in GitHub Desktop.
ping a range of ip and report positive only
#!/bin/bash
range=10.0.1.
for digit in $(seq 1 254);
do
ping -c1 -W100 $range$digit >/dev/null 2>&1
if [ "$?" -eq "0" ]; then
echo $range$digit
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment