Date: Sun, 3 Jul 2005 18:17:22 -0300 From: Alejandro Pulver <alejandro@varnet.biz> To: fbsd_user@a1poweruser.com Cc: "freebsd-questions@FreeBSD. ORG" <freebsd-questions@FreeBSD.ORG> Subject: Re: help with she script Message-ID: <20050703181722.6d20fe89@phobos.mars.bsd> In-Reply-To: <MIEPLLIBMLEEABPDBIEGKEBOHIAA.fbsd_user@a1poweruser.com> References: <20050703163319.58bd970c@phobos.mars.bsd> <MIEPLLIBMLEEABPDBIEGKEBOHIAA.fbsd_user@a1poweruser.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On Sun, 3 Jul 2005 16:47:24 -0400 "fbsd_user" <fbsd_user@a1poweruser.com> wrote: > > Thanks guys your solutions have worked and I am learning allot along > the way. > You are welcome. > This is my last coding problem. > > > target="check-state" > > # Find the rule number of the target rule where you want the doorman > # pass rules inserted before. > > ruleno=`ipfw list | sed -n -e "s/00\([0-9]*\) $target/\1/p"` > > The output of 'ipfw list' looks like this > > nnnnn a 5 position sequence rule number > blank followed by a empty single position > x-x a 10 to 80 position rule text > > > When the rule text matches the target text I want the > first 5 position rule number to go into ruleno. > > Large rules files may use all 5 positions and then > the above code will fail to get the rule number. > Tried to remove the s/00\ but had syntax problems. > Hello, I do not have ipfw, and I do not know how the rules are supposed to be, and how they have to be processed. Could you please send me some example rules, and the expected output to be assigned to "ruleno"? Thanks and Best Regards, Ale
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20050703181722.6d20fe89>