1 |
#!/usr/bin/perl |
#!/usr/bin/perl -w |
2 |
# |
# |
3 |
# Return a list of hosts which not reachable via ICMP echo |
# Return a list of hosts which not reachable via ICMP echo |
4 |
# |
# |
62 |
# this part will strip everything after hostname |
# this part will strip everything after hostname |
63 |
foreach (@ARGV) { |
foreach (@ARGV) { |
64 |
if (m/^[^:]+:?[^\@]*\@([^\/]+)\/?.*/) { |
if (m/^[^:]+:?[^\@]*\@([^\/]+)\/?.*/) { |
65 |
push @hosts,$1; |
my $host = $1; |
66 |
|
push @hosts,$host if (! grep /^$host$/,@hosts); |
67 |
} else { |
} else { |
68 |
push @hosts,$_; |
push @hosts,$_ if (! grep /^$_$/,@hosts); |
69 |
} |
} |
70 |
} |
} |
71 |
|
|