From owner-freebsd-questions@FreeBSD.ORG Mon Jun 15 11:48:51 2015 Return-Path: Delivered-To: freebsd-questions@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 53BC9E47 for ; Mon, 15 Jun 2015 11:48:51 +0000 (UTC) (envelope-from rwmaillists@googlemail.com) Received: from mail-wg0-x231.google.com (mail-wg0-x231.google.com [IPv6:2a00:1450:400c:c00::231]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DA57B822 for ; Mon, 15 Jun 2015 11:48:50 +0000 (UTC) (envelope-from rwmaillists@googlemail.com) Received: by wgbhy7 with SMTP id hy7so33431138wgb.2 for ; Mon, 15 Jun 2015 04:48:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20120113; h=date:from:to:subject:message-id:in-reply-to:references:mime-version :content-type:content-transfer-encoding; bh=9RDW1bOUs5btUMFCd1CThgXDlDnxzDomFVQAlpTeZy4=; b=Nal5me7gjm01LdDPIA6qNZqj3yTQgLdAnffgh6bVRo4EOgnj2pOXmkggH+nQuBS+oJ +m+Q4tfmBrelRkx+rrUK1FO2zHMx0E5zr2X261YGCMpUnUGrCd80oxnMqm2dqQjt4ZTn qqKHUXsYp44eaXnXrMcxEImN1qEtAMN9zqMlUYiOZRXhy2pOQwf6Qog9xGGlNy99YoqF TgwBvkhwOidUl/hyy8xw45VtX0GkH8wTM7LN7XAxZ7ICzzdfHPj/l0xyhVPz/NZyqtPr kby/ZcKlG37S5ribOPPM8x0QA7NSBomfrlybh85iV0xKrHreM4LSU2XieQDisIfJigEw fTBQ== X-Received: by 10.180.100.74 with SMTP id ew10mr31602153wib.12.1434368929430; Mon, 15 Jun 2015 04:48:49 -0700 (PDT) Received: from gumby.homeunix.com (5ec1f6c8.skybroadband.com. [94.193.246.200]) by mx.google.com with ESMTPSA id yz3sm18570089wjc.19.2015.06.15.04.48.47 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 15 Jun 2015 04:48:48 -0700 (PDT) Date: Mon, 15 Jun 2015 12:48:44 +0100 From: RW To: freebsd-questions@freebsd.org Subject: Re: Script question Message-ID: <20150615124844.0110612c@gumby.homeunix.com> In-Reply-To: References: X-Mailer: Claws Mail 3.11.1 (GTK+ 2.24.27; amd64-portbld-freebsd10.0) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Jun 2015 11:48:51 -0000 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= 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.