From owner-freebsd-questions@FreeBSD.ORG Sun Aug 29 20:12:28 2004 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id C192216A4CE for ; Sun, 29 Aug 2004 20:12:28 +0000 (GMT) Received: from ns1.tiadon.com (SMTP.tiadon.com [69.27.132.161]) by mx1.FreeBSD.org (Postfix) with ESMTP id 76F0D43D3F for ; Sun, 29 Aug 2004 20:12:28 +0000 (GMT) (envelope-from kdk@daleco.biz) Received: from [69.27.131.0] ([69.27.131.0]) by ns1.tiadon.com with Microsoft SMTPSVC(6.0.3790.0); Sun, 29 Aug 2004 15:16:04 -0500 Message-ID: <413238A9.7060909@daleco.biz> Date: Sun, 29 Aug 2004 15:12:25 -0500 From: "Kevin D. Kinsey, DaleCo, S.P." User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.7) Gecko/20040712 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Matt Emmerton References: <200408291538.06836.FreeBSD@InsightBB.com> <003c01c48e03$58827fd0$1200a8c0@gsicomp.on.ca> In-Reply-To: <003c01c48e03$58827fd0$1200a8c0@gsicomp.on.ca> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 29 Aug 2004 20:16:05.0243 (UTC) FILETIME=[032C44B0:01C48E05] cc: Steven Friedrich cc: FreeBSD-Questions Subject: Re: finding the ip address X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 Aug 2004 20:12:28 -0000 Matt Emmerton wrote: >>I'm messing with ubermon for superkaramba and I want to know how to get my >>hosts ip address from the command line (and only the ip address). >> >>I know I can grep and sed rc.conf or the output of ifconfig, but I'm >> >> >hoping > > >>there's a command like whoami for the ip address. >> >> > >There isn't anything that simple, but munging the output of ifconfig is what >you want. This assumes that your box only has one IP address (other than >localhost): > ># ifconfig -a | grep "inet " | grep -v 127.0.0.1 | awk ' { print $2 } ' >192.168.0.4 > >-- >Matt Emmerton > > But, for simplicity, if you are on a public host: $host `hostname` might do it... KDK