netmask in a script

Dazed_75 lthielster at gmail.com
Wed Oct 26 21:49:40 MST 2011


I would like to apply a netmask to an arbitrary IP in a bash/dash script
(e.g. apply 255.255.255.0 to 173.10.3.155 to get 173.10.3.0).  Is there any
easy way to do that without taking the IP apart, doing 4 operations and
reassembling the results?

-- 
Dazed_75 a.k.a. Larry

The spirit of resistance to government is so valuable on certain occasions,
that I wish it always to be kept alive.
  - Thomas Jefferson
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.PLUG.phoenix.az.us/pipermail/plug-discuss/attachments/20111026/5c462bf7/attachment.html>


More information about the PLUG-discuss mailing list