Shell script for insert ip address into an ordered list of IPs
Could anyone give me some advices?
I need a shell script that takes an IP and inserts it into a file that contains an ordered (for human eyes) lists of IPs - 1 IP / line, followed by a mask and some comments.
List is ordered "for human eyes" I mean for example
122.0.7.x comes before 122.0.11.x
Does anyone have something like this?
Or could you tell me which is the best way to compare an IP to a list of IPs - I want to insert the new IP in the right place, I mean, if the new ip is 220.127.116.11
and the list is
- i want to insert it here
Thanks for any tips