Ever needed to convert IP addresses that someone has written down into a list?
eg: 10.0.0.47 to 52 and 192.168.243.5 to 12
Try seq, as follows:
$seq -f "10.0.0.%g" 3 6 10.0.0.3 10.0.0.4 10.0.0.5 10.0.0.6
Or for my example:
$seq -f "10.0.0.%g" 47 52 ; seq -f "192.168.243.%g" 5 12 10.0.0.47 10.0.0.48 10.0.0.49 10.0.0.50 10.0.0.51 10.0.0.52 192.168.243.5 192.168.243.6 192.168.243.7 192.168.243.8 192.168.243.9 192.168.243.10 192.168.243.11 192.168.243.12
You could then redirect the output too:
$seq -f "10.0.0.%g" 47 52 ; seq -f "192.168.243.%g" 5 12 > ips.txt
Hope this is useful.
(Visited 625 times, 1 visits today)
![Share on Facebook Facebook](https://jervis.ws/wp-content/plugins/social-media-feather/synved-social/image/social/regular/48x48/facebook.png)
![Share on Twitter twitter](https://jervis.ws/wp-content/plugins/social-media-feather/synved-social/image/social/regular/48x48/twitter.png)
![Share on Google+ google_plus](https://jervis.ws/wp-content/plugins/social-media-feather/synved-social/image/social/regular/48x48/google_plus.png)
![Share on Reddit reddit](https://jervis.ws/wp-content/plugins/social-media-feather/synved-social/image/social/regular/48x48/reddit.png)
![Pin it with Pinterest pinterest](https://jervis.ws/wp-content/plugins/social-media-feather/synved-social/image/social/regular/48x48/pinterest.png)
![Share on Linkedin linkedin](https://jervis.ws/wp-content/plugins/social-media-feather/synved-social/image/social/regular/48x48/linkedin.png)
![Share by email mail](https://jervis.ws/wp-content/plugins/social-media-feather/synved-social/image/social/regular/48x48/mail.png)