Changeset 18855


Ignore:
Timestamp:
2009-12-19T23:19:34+01:00 (8 years ago)
Author:
nbd
Message:

libipfix: specify the number of the wprobe ie append script on the command line

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/package/libipfix/extra/append-wprobe-ie.pl

    r18852 r18855  
    77); 
    88 
    9 my $file = $ARGV[0] or die "Syntax: $0 <file>\n"; 
     9my $file = $ARGV[0] or die "Syntax: $0 <file> <start>\n"; 
    1010-f $file or die "File not found\n"; 
    11 my $last_ie = 0; 
    12 my $line; 
    13 open IES, "<$file" or die "Can't open file"; 
    14 while ($line = <IES>) { 
    15         $line =~ /^(\d+)\s*,/ and $last_ie = $1; 
    16 } 
    17 close IES; 
    18 while (<STDIN>) { 
     11my $start = $ARGV[1]; 
     12$start =~ /^\d+$/ or die "Invalid start number"; 
     13open FILE, "<$file" or die "Can't open file"; 
     14while (<FILE>) { 
    1915        /^(%?)(\w+),\s*(\w+),\s*(.+)$/ and do { 
    2016                my $counter = $1; 
     
    2925                } 
    3026                foreach my $f (@f) { 
    31                         my $nr = ++$last_ie; 
     27                        my $nr = $start++; 
    3228                        my $n = $f->[0]; 
    3329                        my $N = uc $n; 
     
    3935        }; 
    4036} 
     37close FILE; 
    4138 
Note: See TracChangeset for help on using the changeset viewer.