Ip
De BlaxWiki
Révision datée du 10 avril 2013 à 16:23 par 217.174.199.129 (discussion)
Ce script sert à éclater des ip une à une, dans le cas ou nous avons une liste d'ip comme ca :
10.252.5.161-10.252.5.174 10.252.5.181 10.252.5.192-10.252.5.197
Cela nous donnera :
10.252.5.161 10.252.5.162 . . . 10.252.5.174 10.252.5.192 10.252.5.193 . . 10.252.5.197 10.252.5.181
- Script
for i in `grep -- - ips.txt `; do a=`echo $i | cut -d '.' -f 4 | cut -d '-' -f 1`; b=`echo $i | cut -d '.' -f 7`; c=`echo $i | cut -d '.' -f 1-3`;for j in `seq $a $b`; do echo $c.$j >> ips_detail.txt ;done;done; grep -v -- - ips.txt >> ips_detail.txt