From owner-freebsd-questions Sat Jun 1 15:31:24 2002 Delivered-To: freebsd-questions@freebsd.org Received: from gull.mail.pas.earthlink.net (gull.mail.pas.earthlink.net [207.217.120.84]) by hub.freebsd.org (Postfix) with ESMTP id 7866137B406 for ; Sat, 1 Jun 2002 15:31:19 -0700 (PDT) Received: from sdn-ar-004dcwashp228.dialsprint.net ([206.133.21.244] helo=moo.holy.cow) by gull.prod.itd.earthlink.net with esmtp (Exim 3.33 #2) id 17EHOz-0000hC-00; Sat, 01 Jun 2002 15:31:14 -0700 Received: by moo.holy.cow (Postfix, from userid 1001) id 3CD39510C3; Sat, 1 Jun 2002 18:33:50 -0400 (EDT) Date: Sat, 1 Jun 2002 18:33:50 -0400 From: parv To: Patrick Thomas Cc: freebsd-questions@freebsd.org Subject: Re: two ipfw questions... Message-ID: <20020601223350.GA20449@moo.holy.cow> Mail-Followup-To: Patrick Thomas , freebsd-questions@freebsd.org References: <20020531110825.I18408-100000@utility.clubscholarship.com> <20020531191840.GA52186@moo.holy.cow> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20020531191840.GA52186@moo.holy.cow> 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 in message <20020531191840.GA52186@moo.holy.cow>, wrote parv/pair thusly... > > in message <20020531110825.I18408-100000@utility.clubscholarship.com>, > wrote Patrick Thomas thusly... ... > > For instance, if you `ipfw show` you get: > > > > 00100 7750 1619098 allow udp from any 53 to 10.10.10.10 > > > > how can I output that to: > > > > ipfw add 00100 allow udp from any 53 to 10.10.10.10 > > based on your input & output, can be easily done via awk... > > ipfw show | awk ' BEGIN { rule = "ipfw add" } > { > rule = rule" "$1 > for (i = 4; i <= NF; i++) > { rule = rule" "$i } > } > END { print rule }' > my bad... that's not what you really want, this is... ipfw show | awk '{ rule = "ipfw add "$1 for (i = 4; i <= NF; i++) { rule = rule" "$i } print rule }' -- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message