Date: Mon, 15 Jun 2015 12:48:44 +0100 From: RW <rwmaillists@googlemail.com> To: freebsd-questions@freebsd.org Subject: Re: Script question Message-ID: <20150615124844.0110612c@gumby.homeunix.com> In-Reply-To: <BAY182-W89C2924F4BDF0D2BD3810DF4BB0@phx.gbl> References: <BAY182-W89C2924F4BDF0D2BD3810DF4BB0@phx.gbl>
next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, 12 Jun 2015 18:53:25 -0500 Lt. Commander wrote: > I do know how to extract just the IP from a line in the log, but not > sure what the syntax should be to first ID the "score=<x" in a simple > sh shell script. When I do something like this I often just use a regular expression to match the number. If the limit is simple, and the format consistent, it's often simpler. e.g. for <120.0 score=(-|[0-9]{1,2}|1[01][0-9])\. It's worth knowing this because sometimes (outside of shell scripts) it's the only way of doing it.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20150615124844.0110612c>