From owner-freebsd-questions Sun Mar 9 21:30:33 2003 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 985E237B401 for ; Sun, 9 Mar 2003 21:30:32 -0800 (PST) Received: from pimout4-ext.prodigy.net (pimout4-ext.prodigy.net [207.115.63.103]) by mx1.FreeBSD.org (Postfix) with ESMTP id C353B43FBF for ; Sun, 9 Mar 2003 21:30:31 -0800 (PST) (envelope-from metrol@metrol.net) Received: from metlap (adsl-67-121-60-9.dsl.anhm01.pacbell.net [67.121.60.9]) by pimout4-ext.prodigy.net (8.12.3 da nor stuldap/8.12.3) with ESMTP id h2A5UUaj096044; Mon, 10 Mar 2003 00:30:30 -0500 From: Michael Collette To: David Banning Subject: Re: identifying my network address Date: Sun, 9 Mar 2003 21:30:22 -0800 User-Agent: KMail/1.5 Cc: FreeBSD Mailing Lists MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200303092130.22748.metrol@metrol.net> Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG David Banning wrote: > I am running an Xwindow on a windows box. I need a script to > tell me what my network address is so that I can set my DISPLAY > varible correctly eg: 192.168.1.2:0.0 > > Any idea what command would be useful for this purpose? It's ugly. It won't work if you multiple NICs. It may just work for what you need just the same. echo `ifconfig | grep broadcast | cut -d" " -f2`":0.0" This takes the output of ifconfig and parses it just a wee bit with grep and cut. I use something very similar to this in a script that changes my network settings for my laptop on the fly. Let me know if this works for ya. Later on, -- "Outside of a dog, a book is man's best friend. Inside of a dog, it's too dark to read." - Groucho Marx To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message