Under the heading of "I've seen how to do this in my travels by CRS has set in" I remember seeing an algorithm (or may have actually written the thing myself) to take an unsorted list of IP addresses, sort them and then substitute ranges for sequential addresess.
Just so I'm clear as to what I'm after, here's a small sample list:
The expected output would look like:10.0.4.100 10.0.4.99 10.3.5.21 10.0.4.101 10.15.21.6
10.0.4.99-10.0.4.101 10.3.5.21 10.15.21.6
Has anybody done written anything like this or have an idea how to efficiently do this?
| Peter L. Berghold -- Unix Professional Peter at Berghold dot Net | |
| Dog trainer, dog agility exhibitor, brewer of fine Belgian style ales. Happiness is a warm, tired, contented dog curled up at your side and a good Belgian ale in your chalice. | |
In reply to Unsorted IP Addr list to sorted IP list with ranges by blue_cowdawg
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |