On Tue, 11 Dec 2012 19:33:15 +0800
Bill Kenworthy <bi...@iinet.net.au> 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.
> 
> BillK
> 
> 
> 

ip tends to be a little more consistent and a little more
script-friendly than ifconfig:

ip -o addr show

-o prints output on one line, making your subsequent grep, sed and
awking easier

-- 
Alan McKinnon
alan.mckin...@gmail.com


Reply via email to