On Fri, 2006-06-02 at 22:33 -0400, Peter Memishian wrote:
> Usually, we've built this logic into BFU -- e.g., it could notice that a
> backward BFU is being done, and convert the file back to its old format.
> Later on, once we've crossed the "backward BFU grace period", the stuff
> can be hauled out of BFU.

So, I wrote a little nawk script that will take a
new /etc/aggregation.conf, and add the "/0" port numbers to the
component link names of aggregations.  It doesn't touch comment lines
and blank lines:

BEGIN {
        space = "[ \t]";
        blanks = space "*";
        blankline = "^" blanks "$";
        comment = "^" blanks "#";
}

$0 ~ comment {
        print;
        next;
}

$0 ~ blankline {
        print;
        next;
}

{
        numlinks = split($4, links, ",");
        newlinks = links[1] "/0";
        for (i = 2; i <= numlinks; i++) {
                newlinks = newlinks "," links[i] "/0";
        }
        print $1 "\t" $2 "\t" $3 "\t" newlinks "\t" $5 "\t" $6 "\t" $7 
}

Since I'm no awk/nawk expert, I'm sure the above script could be made
more compact or cleaner.  So, awk experts, what say you?

Thanks,
-Seb


_______________________________________________
networking-discuss mailing list
[email protected]

Reply via email to