when we do at the prompt
myhost> whatmask 255.255.192.0
---------------------------------------------
TCP/IP SUBNET MASK EQUIVALENTS
---------------------------------------------
CIDR = .....................: /18
Netmask = ..................: 255.255.192.0
Netmask (hex) = ............: 0xffffc000
Wildcard Bits = ............: 0.0.63.255
Usable IP Addresses = ......: 16,382
we get the above info.
so, I used your code & directed the result to a file called it maskfile. copy the whatmask in tmp& then use the following:
Quote:
ipbits= `/tmp/whatmask "maskfile" | grep "CIDR=."| awk -F/'{print $2}'
|
but it does not work. i want to get the CIDR value only so after insert it at the end of the 4th ip address of the FileA send it to the new file.
i believe i still need your help, thank you.