Re: using grep to find IP address...
From: Bill Marcum (bmarcum_at_iglou.com.urgent)
Date: 05/31/05
- Next message: Bill Marcum: "Re: running program in background"
- Previous message: Will Renkel: "RE: Highlighting text and using paste with middle mouse"
- Maybe in reply to: Chris F.A. Johnson: "Re: using grep to find IP address..."
- Next in thread: Bill Seivert: "Re: using grep to find IP address..."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
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
- Next message: Bill Marcum: "Re: running program in background"
- Previous message: Will Renkel: "RE: Highlighting text and using paste with middle mouse"
- Maybe in reply to: Chris F.A. Johnson: "Re: using grep to find IP address..."
- Next in thread: Bill Seivert: "Re: using grep to find IP address..."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|