Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 26 Mar 2001 15:49:44 -0600
From:      Philip Kizer <pckizer@nostrum.com>
To:        Mikel <mikel@ocsinternet.com>
Cc:        Johnny Dang <johnny.dang@johnnydang.net>, FreeBSD IpFW <FREEBSD-IPFW@FreeBSD.ORG>
Subject:   Re: Scripting with IPFW 
Message-ID:  <200103262149.f2QLniB61827@magus.nostrum.com>
In-Reply-To: Your message of "Mon, 26 Mar 2001 16:38:19 EST." <3ABFB6CB.4A876CC2@ocsinternet.com> 

next in thread | previous in thread | raw e-mail | index | archive | help
Mikel <mikel@ocsinternet.com> 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       <usenix@tamu.edu>
Texas A&M CIS Operating Systems Group, Unix <pckizer@tamu.edu>

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-ipfw" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200103262149.f2QLniB61827>