Sometimes I find myself doing the dumbest things ever, like needing a list of ip addresses for a tool that doesn’t accept CIDR notation for target addresses. The tool is unimportant other than it being poorly designed and inefficient as hell, what is important however is that I slapped together a set of 3 loops in a bash script to use the seq tool to generate a massive number of ip addresses. Its really slow actually, so slow that it generates like 250k every 5 seconds which really isnt that much for a simple task like this, I think my prime number code is quicker and its doing actual math. Anyway if someone happens to want this for some god-awful purpose have at it, its terrible and I should probably feel terrible for writing something this ugly
1 2 3 4 5 6 7 8 9 10 11 |
#!/bin/bash for i in `seq -f "73.%g" 1 254` do for ii in `seq -f "$i.%g" 1 254` do for iii in `seq -f "$ii.%g" 1 254` do echo $iii done done done |