From owner-freebsd-questions@FreeBSD.ORG Sat Jun 13 17:53:17 2015 Return-Path: Delivered-To: freebsd-questions@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E44E3705 for ; Sat, 13 Jun 2015 17:53:17 +0000 (UTC) (envelope-from jd1008@gmail.com) Received: from mail-ie0-x230.google.com (mail-ie0-x230.google.com [IPv6:2607:f8b0:4001:c03::230]) (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 AAA959F8 for ; Sat, 13 Jun 2015 17:53:17 +0000 (UTC) (envelope-from jd1008@gmail.com) Received: by iesa3 with SMTP id a3so40821162ies.2 for ; Sat, 13 Jun 2015 10:53:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; bh=JBLOr/bks/u9YHsEIC6XpohjSCU975vM1mL3Re+N51U=; b=CAzyrBb9C1GORbHQ1Up+jcrALyri9hLHA/EzDOHF0Ov/WsO4zcxNxA/Fko7tioGZOh G2hGunNE3agdCiO6lCL7fO4Wq2FlDV+iw7Wy5/NIst6tHZYlCk9NeQ7Wiqs1tA0Nm6Co eNoLUk0wssHZfB1IsnGGO/lZF24YrYoO4vU2qsw1OHDwPbk5pa//sj6DlRO2WFiEbrUG 1wKRBkN1ydPadBJ26SrvulhOb+2uKPGy0d1SKnkzUo1mCBFsN2DF3Eh0+1ebEkR+xU46 nM+2qW/Ye72bRtYquEzdMx4sYgJJhyaR6XO2fYt05MlwpSrXUHQdlgWn8OrHejz+cOPw TNiw== X-Received: by 10.50.29.40 with SMTP id g8mr11377402igh.41.1434217996970; Sat, 13 Jun 2015 10:53:16 -0700 (PDT) Received: from localhost.localdomain ([50.243.6.59]) by mx.google.com with ESMTPSA id d8sm3755830igl.19.2015.06.13.10.53.15 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 13 Jun 2015 10:53:16 -0700 (PDT) Message-ID: <557C6DED.9070105@gmail.com> Date: Sat, 13 Jun 2015 11:52:45 -0600 From: jd1008 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: freebsd-questions@freebsd.org Subject: Re: Script question References: , , , <557B8484.9060405@gmail.com> In-Reply-To: Content-Type: text/plain; charset=windows-1252; format=flowed 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: Sat, 13 Jun 2015 17:53:18 -0000 On 06/13/2015 06:58 AM, Lt. Commander wrote: >> Date: Fri, 12 Jun 2015 19:16:52 -0600 >> From: jd1008@gmail.com >> To: freebsd-questions@freebsd.org >> Subject: Re: Script question > Here is a short shell script: > > #!/bin/sh > > while read line; do > score=`echo $line | grep ' score=.. '` > scoreValue=`echo $score | sed -e 's/score=//' -e 's/ *//'` > address=`echo $line | grep 'client_addr=[0-9]*\.[0-9]*\.[0-9]*.[0-9]* '` > IP=`echo $address | sed 's/client_addr=//'` > > if [ $scoreValue -ge 12 ]; then > echo $score > echo $IP > echo ==================== > fi > done < your-log-file-name> some-file-to-use-to-construct-the-spamassasin filter > > ---------------------------------------- >> Date: Fri, 12 Jun 2015 19:16:52 -0600 >> From: jd1008@gmail.com >> To: freebsd-questions@freebsd.org >> Subject: Re: Script question >> > That's a very interesting shell script and will give it a try. > > But, does the script only pickup spam with a "12" tag level or does it pick up 12 and above which is what I need? (sorry, my scripting is not strong). > > Jason The boolean -ge in the if test. Greater than or equal to So it grabs all 12 or greater values. > > _______________________________________________ > freebsd-questions@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-questions > To unsubscribe, send any mail to "freebsd-questions-unsubscribe@freebsd.org" >