[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Can we kill net-tools, please? (and this thread)



Geert Stappers writes ("Re: Can we kill net-tools, please? (and this thread)"):
> This e-mail is to request to leave this thread in the year 2016.
> We have concencus that the install priority of net-tools should be lowered.

That has been done.

> It doesn't matter what is "easy" with "ip" or with "ifconfig|route|arp"
> It is important that we can let go net-tools.

Unfortunately, bundled in with your request to leave the thread for
2016, was another message arguing that `ip' is easy.  So your request
is actually a request to have the last word.

> |>  10: secondary    inet 10.2.3.4/32 scope global secondary\ valid_lft forever preferred_lft forever
> |>  11: home    inet 10.4.5.6/32 scope global home home\       valid_lft forever preferred_lft forever
> |> 
> |> How is a parser supposed to know which of these words are what ?
> 
> The position of the words.

Can you please provide a simple regexp or parser which, given a
keyword like `secondary', `home', `scope', `valid_lft' or whatever,
will tell whether that keyword is present and if so what (if any)
value it has ?

For example, something like this:

  sub extract_value_from_ip_o_addr_line ($$) {
      my ($line, $keyword) = @_;
      if ($line =~ m/ $keyword (\S+)/) {
          return $1;
      } else {
          return undef;
      }
  }

Only without the many bugs.

Ian.

-- 
Ian Jackson <ijackson@chiark.greenend.org.uk>   These opinions are my own.

If I emailed you from an address @fyvzl.net or @evade.org.uk, that is
a private address which bypasses my fierce spamfilter.


Reply to: