Re: using grep to find IP address...

From: Bill Marcum (bmarcum_at_iglou.com.urgent)
Date: 05/31/05


Date: Tue, 31 May 2005 16:04:49 -0400

On 31 May 2005 08:30:41 -0700, balgach@gmail.com
  <balgach@gmail.com> wrote:
> Hello all, i am interested in the last 255 bits of the local machines
> ip address (aka the last number after the period) so far ive been
> using the command, i know all the ip address start with 192.168
>
> ifconfig | grep '192.168' | awk '{print $2}'
>
> which is returning:
>
> inet addr:192.168.0.20
>
>
> now how do i get it just to return the '20' ??
>
ifconfig | awk '/192.168/{split($2,adr,"."); print adr[4]}'

-- 
Depend on the rabbit's foot if you will, but remember, it didn't help
the rabbit.
		-- R.E. Shay


Relevant Pages

  • Re: using grep to find IP address...
    ... Greg Beeker wrote: ... i am interested in the last 255 bits of the local machines ... >>ip address (aka the last number after the period) so far ive been ... Regards, ...
    (comp.unix.shell)
  • Re: using grep to find IP address...
    ... i am interested in the last 255 bits of the local machines ... > ip address (aka the last number after the period) so far ive been ... use Perl; ...
    (comp.unix.shell)
  • Re: using grep to find IP address...
    ... i am interested in the last 255 bits of the local machines ... > ip address (aka the last number after the period) so far ive been ... > Adam. ... Bill Seivert ...
    (comp.unix.shell)
  • Re: using grep to find IP address...
    ... i am interested in the last 255 bits of the local machines ... > ip address (aka the last number after the period) so far ive been ... Thorn ... "I am not sure what this is, but an `F' would only dignify it." ...
    (comp.unix.shell)
  • Re: This is my stalker, Donna
    ... all a 100% dude wearing a tgif outfit and high heels, ... seeing a six foot man in heels!! ... In a reply to Mercury (aka Kevysmom, aka Mercury.Sailor, ...
    (misc.health.alternative)