From owner-freebsd-ipfw Mon Mar 26 13:50: 5 2001 Delivered-To: freebsd-ipfw@freebsd.org Received: from magus.nostrum.com (magus.nostrum.com [216.90.209.2]) by hub.freebsd.org (Postfix) with ESMTP id 1C4EA37B718 for ; Mon, 26 Mar 2001 13:50:01 -0800 (PST) (envelope-from pckizer@nostrum.com) Received: (from pckizer@localhost) by magus.nostrum.com (8.11.0/8.11.0) id f2QLniB61827; Mon, 26 Mar 2001 15:49:44 -0600 (CST) Message-Id: <200103262149.f2QLniB61827@magus.nostrum.com> From: Philip Kizer To: Mikel Cc: Johnny Dang , FreeBSD IpFW Subject: Re: Scripting with IPFW In-reply-to: Your message of "Mon, 26 Mar 2001 16:38:19 EST." <3ABFB6CB.4A876CC2@ocsinternet.com> Date: Mon, 26 Mar 2001 15:49:44 -0600 Sender: owner-freebsd-ipfw@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Mikel wrote: >Hey man cool, hope you don't mind I had to try your script out and well I came >up with this...thanks for sending back the code byte... > >#!/bin/sh >oif=`ifconfig fxp0 |grep inet | head -1 | awk '{print $2}'` Ouch, it's always a bit painful seeing long pipes when one of the commands already used can be the only piped command: try: oif=`ifconfig fxp0 | awk '/inet/{print$2;exit}'` Hope that helps, the others can be formulated similarly. -philip -- Philip Kizer, USENIX Liaison to Texas A&M University Texas A&M CIS Operating Systems Group, Unix To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-ipfw" in the body of the message