Good Day Everyone!
I have a list of ASN numbers in a text file which I want to use as INPUT for the following script shared in github
https://github.com/nitefood/asn/
I want to redirect the output of every ASN number to a separate file (appending is fine) so my sample script looks as following-
#!/bin/bash
while IFS= read -r ASN; do
asn $ASN >> ASN_info
sleep 10
done < ASN_LIST
So, my while loop just keeps iterating without waiting to finish the redirection to the file and shows the output like below-
Please help to modify my silly script to redirect entire output for every ASN number from the input file.Will really appreciate the community's help :)
Top comments (1)
Hey!
asn
author here. You can use JSON mode to easily accomplish that. If I get it right you're looking to associate AS numbers to their IP ranges. An example using only IPv4 ranges could be done like this:Of course you can also include IPv6 ranges by including the relevant fields from the JSON output.
HTH