Skip to content

Instantly share code, notes, and snippets.

@riccardobl
Last active August 29, 2015 14:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save riccardobl/8a3d26c14dce3e74de3d to your computer and use it in GitHub Desktop.
Save riccardobl/8a3d26c14dce3e74de3d to your computer and use it in GitHub Desktop.
# ip2cidr = http://www.linuxweblog.com/blogs/sandip/20080515/ip-range-cidr-conversion
echo "">$1.cidr
while read -r line
do
parts=($(echo $line))
start=${parts[0]}
end=${parts[1]}
echo $start,$end
ip2cidr $start-$end >> $1.cidr
done < <(cat $1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment