public inbox for gentoo-user@lists.gentoo.org
 help / color / mirror / Atom feed
From: Helmut Jarausch <jarausch@igpm.rwth-aachen.de>
To: gentoo-user@lists.gentoo.org
Subject: Re: [gentoo-user] ifconfig and ppp0 address
Date: Tue, 11 Dec 2012 13:08:05 +0100	[thread overview]
Message-ID: <1355227685.7888.0@numa-i> (raw)
In-Reply-To: <1355225595.25046.5.camel@bunyip>

On 12/11/2012 12:33:15 PM, Bill Kenworthy wrote:
> For years I have been using ifconfig and some simple shell magic to
> extract the ip address from the adsl ppp session when it changes.  The
> latest update has changed the output format of ifconfig breaking  
> things
> so if ifconfig cant be relied on, what's normally used to extract an
> interfaces IP address?  I can easily rewrite the shell magic, but its
> worth asking if there is some command better suited.
> 

If you're a Python fan there is a nice tool to replace 'awk' and  
similar tools:
svn checkout http://pyp.googlecode.com/svn/trunk/ pyp

I've patched this to include a 'balanced' (parenthesis, brackets,..)

With the original version I use

ifconfig wlan0 | /usr/local/bin/pyp  
"pp.after('wlan0',2)|p[1]|p.re(r'(?<=inet )\d+\.\d+\.\d+\.\d+')"

If someone is interested in my patch I'm happy to share it,
Helmut.



  parent reply	other threads:[~2012-12-11 12:11 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-12-11 11:33 [gentoo-user] ifconfig and ppp0 address Bill Kenworthy
2012-12-11 11:55 ` Alan McKinnon
2012-12-11 12:08 ` Helmut Jarausch [this message]
2012-12-11 15:28 ` David W Noon
2012-12-11 17:43   ` Kevin Chadwick
2012-12-13 15:33     ` Trevor D. Manning
2012-12-14  0:06       ` David W Noon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1355227685.7888.0@numa-i \
    --to=jarausch@igpm.rwth-aachen.de \
    --cc=gentoo-user@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox