Find the answer to your Linux question:
Results 1 to 2 of 2
Hi, i want to create a script that will check the ports of a range of IPs. I could write all the IPs, but i have thought there is maybe ...
  1. #1
    Just Joined!
    Join Date
    Apr 2007
    Posts
    22

    A script to check ports of a long range of IPs

    Hi,

    i want to create a script that will check the ports of a range of IPs.

    I could write all the IPs, but i have thought there is maybe a way to write the rage instead of all the IPs.

    Is that true?

    Do you advice any language to write this kind of scripts?

    Çiao

  2. #2
    Just Joined!
    Join Date
    Jul 2009
    Posts
    7

    use Seq

    If you are doing shell scripting then as far as I know.. I dont think there is anything developed in shell scripting specifically for defining IP range. However in this case I would like to suggest to use 'seq' command to specify the IP range for each mask from 0-255 like
    seq 0 255
    and then in for loop
    for $i in $(seq 1 255) do
    echo "1.1.1.$i"
    echo "1.1.$i.1"
    echo "1.$i.1.1"
    echo "$i.1.1.1"
    done


    Good luck.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...