Hi guys,

I am Brazillian and i don't know how to speak english very well, but, let's to the question:

I need a solution to automatically write a sequence of number to a file, for example, to write automatically to a file the number 1 at 254, this is what i need to create a address list to use with a IP firewall,

Thanks for all and sorry for the gramatical errors.

Hello modesto916,

could you please provide some more details?
It is a little bit hard to figure out exactly what you are asking for.

Well, just guessing, but as a starting point let me assume
having a file with incomplete IP addresses in a file called "iplist":

cat iplist


Now If you want continuous and complete IP adresses just try

awk '{ print $0 NR }' iplist

which should print on stdout:

Apologizes for most likely being totally wrong.
You might want to show a sample input file
and how the result[s] should look alike?

Kind regards,

Nice issue9!

I'd probably use 'seq' to generate those numbers personally. Something like this: seq 1 254 To generate a list of IPs like in issue's example: for i in $(seq 1 254); do echo "192.168.0.$i"; done You've probably got a solution by now, but I hope this helps somebody!


Edited 6 Years Ago by JeoSaurus: n/a

This article has been dead for over six months. Start a new discussion instead.