Created
February 3, 2019 02:31
-
-
Save mccabe615/563b30600b62b54a4df4c617afc955c9 to your computer and use it in GitHub Desktop.
Determine number of hosts for subnet from file
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
while IFS="" read -r p || [ -n "$p" ]; | |
do | |
printf '%s' "$p -- Hosts: "; | |
subnetcalc $p|grep "Max. Hosts"|awk '{ print $4 }'; | |
done < hosts.txt | |
# while IFS="" read -r p || [ -n "$p" ]; do printf '%s' "$p -- Hosts: "; subnetcalc $p|grep "Max. Hosts"|awk '{ print $4 }'; done < hosts.txt |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment