[SATLUG] Ping Scan A Range of Addresses

Larry Blodgett lblodgett at macosx.com
Fri Oct 1 08:49:54 CDT 2004


On Oct 1, 2004, at 7:25 AM, Ed Coates wrote:

> On Fri, 1 Oct 2004 00:07:59 -0500, Larry Blodgett 
> <lblodgett at macosx.com> wrote:
>> On Sep 30, 2004, at 3:22 PM, Ed Coates wrote:
>>
>> Ed,
>> As you can see I am using BSD (jot)
>>
>> #!/bin/bash
>> for ii in `jot - 1 20 1`
>> do
>>      echo "testing ${ii}"
>>     if ping -c 1 129.162.184.${ii} > /dev/null 2>&1
>>     then
>>         echo "129.162.184.${ii} is alive"
>>     fi
>> done
>>
>> Just one last question, would you pleas explain the if statement.
>> It doesn't seem to be working. Every test comes back alive.
>> Larry
> Larry,
>
> Didn't realize that you were using BSD.  :)  You might have to do a
> man on BSD's ping command.  The above in linux will send 1 ping packet
> to the machine and return true if it succeds.  BSD might have a
> different switch other than "-c" for that, or it might be a different
> syntax.
>
> Ed
>
Ed,
Thanks for all your help.  I will do as you say and check it out.  I
thought there may be other BSD users on this list who would know the
answer.  Thanks again for all your help.

Larry



More information about the Satlug mailing list