Re: using grep to find IP address...
From: Greg Beeker (gbeeker_at_gmail.com)
Date: 05/31/05
- Next message: Thorn: "Re: using grep to find IP address..."
- Previous message: Bill Marcum: "Re: How to read text from a file in shell scripting"
- In reply to: balgach_at_gmail.com: "using grep to find IP address..."
- Next in thread: Ed Morton: "Re: using grep to find IP address..."
- Reply: Ed Morton: "Re: using grep to find IP address..."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 31 May 2005 08:57:53 -0700
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 | grep '192.168' | awk '{print $2}' | awk -F. '{print $4}'
- Next message: Thorn: "Re: using grep to find IP address..."
- Previous message: Bill Marcum: "Re: How to read text from a file in shell scripting"
- In reply to: balgach_at_gmail.com: "using grep to find IP address..."
- Next in thread: Ed Morton: "Re: using grep to find IP address..."
- Reply: Ed Morton: "Re: using grep to find IP address..."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|