Date: Sat, 13 Jun 2015 11:52:45 -0600 From: jd1008 <jd1008@gmail.com> To: freebsd-questions@freebsd.org Subject: Re: Script question Message-ID: <557C6DED.9070105@gmail.com> In-Reply-To: <BAY182-W64842DB24FDD6D0F3A1854CCBA0@phx.gbl> References: <BAY182-W89C2924F4BDF0D2BD3810DF4BB0@phx.gbl>, <CA%2Bg%2BBvjNv0PBOfmnWkzE26Tgqj6qZ-VKbHXMpuB8gak69G_T2g@mail.gmail.com>, <BAY404-EAS263BBC0728E6171BD47A4AECCBA0@phx.gbl>, <557B8484.9060405@gmail.com> <BAY182-W64842DB24FDD6D0F3A1854CCBA0@phx.gbl>
next in thread | previous in thread | raw e-mail | index | archive | help
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" >
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?557C6DED.9070105>