On Fri, 2006-06-16 at 21:09 +0100, Paul Jakma wrote:
>
> collapse the other-line munching as per meem.
>
>
> > {
> > 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
> > }
>
> Replace with:
>
> {
> gsub(/[^,]*/, "&/0", $4);
> print;
> }
Hmm, that has the strange side-effect of replacing all of the tabs
separating the fields with spaces (in all of $0). For example, the
input line:
1 L4 2 bge1,bge0 auto off short
turns into
1 L4 2 bge1/0,bge0/0 auto off short
Any idea why gsub() would do that?
-Seb
_______________________________________________
networking-discuss mailing list
[email protected]