From: short <> Date: Sat, 16 Oct 2004 09:43:44 +0000 (+0000) Subject: Support interfaces name expansion syntax: eth{0-1}.{2-24} X-Git-Url: https://git.jankratochvil.net/?p=harpy.git;a=commitdiff_plain;h=1cac25d7ec30e9a8d80208ee89ce83dd679f79be Support interfaces name expansion syntax: eth{0-1}.{2-24} --- diff --git a/harpy b/harpy index cb02bd2..1c314e1 100755 --- a/harpy +++ b/harpy @@ -183,7 +183,13 @@ my($msg)=@_; my %socks; -for my $ifname (@ARGV) { +my @ifnames=@ARGV; +while (@ifnames) { + my $ifname=shift @ifnames; + if ($ifname=~/{(\d+)-(\d+)}/) { + push @ifnames,$`.$_.$' for $1..$2; + next; + } my($sock,$hw)=sock($ifname); $socks{$ifname}={ "sock"=>$sock,