Script question
RW
rwmaillists at googlemail.com
Mon Jun 15 11:48:51 UTC 2015
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.
More information about the freebsd-questions
mailing list