From owner-freebsd-questions@FreeBSD.ORG Mon Apr 28 14:59:24 2003 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 547E337B401 for ; Mon, 28 Apr 2003 14:59:24 -0700 (PDT) Received: from supermail.mweb.co.za (supermail.mweb.co.za [196.2.53.171]) by mx1.FreeBSD.org (Postfix) with ESMTP id 21E8D43F93 for ; Mon, 28 Apr 2003 14:59:23 -0700 (PDT) (envelope-from dj_boris@mail.ru) Received: from [196.7.205.222] (helo=d) by supermail.mweb.co.za with smtp (Exim 3.22 #1) id 19AGWu-0004pt-00 for freebsd-questions@FreeBSD.ORG; Mon, 28 Apr 2003 23:51:21 +0200 Message-ID: <01de01c30dd1$5c5d4c10$6300a8c0@fmelectro.co.za> From: "DJ Boris" To: "freebsd-questions" Date: Mon, 28 Apr 2003 23:57:22 +0200 MIME-Version: 1.0 Content-Type: text/plain; charset="Windows-1252" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2600.0000 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 Subject: extract IP address and feed it into a command 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: Mon, 28 Apr 2003 21:59:24 -0000 hi there, I am running fBSD 4.7 release. I need to extract my IP address which is dynamically assigned by my ISP and feed it into a serialmail command "maildirsmtp ~alias/pppdir alias-ppp- 1.2.3.4 `hostname` " which is executed from my ppp.linkup. I have to replace hostname with my dynamic IP. I know that my IP always starts with zzz.zzz and if I run "ifconfig | grep zzz.zzz" I get inet zzz.zzz.xxx.xxx --> yyy.yyy.yyy.yyy netmask nnnnnnnnnn Is there a command or something else that I can use in order to get only the IP starting with zzz.zzz up to the first space and how do I feed it into the above command? thanx dj boris