Date: Sun, 14 Jun 2015 18:39:03 -0600 From: jd1008 <jd1008@gmail.com> To: freebsd-questions@freebsd.org Subject: Re: Script question Message-ID: <557E1EA7.3080507@gmail.com> In-Reply-To: <2609852.Pc7nSdcYla@desk8.phess.net> References: <BAY182-W89C2924F4BDF0D2BD3810DF4BB0@phx.gbl> <BAY404-EAS148D4B304BB066F07E84004CCB90@phx.gbl> <20150615015516.b3ea7633.freebsd@edvax.de> <2609852.Pc7nSdcYla@desk8.phess.net>
next in thread | previous in thread | raw e-mail | index | archive | help
On 06/14/2015 06:27 PM, Patrick Hess wrote:
> Polytropon wrote:
>> Or if you want to omit the grep call:
>>
>> awk '/spam=YES/ {print $11}' /var/log/maillog | sort | uniq | sed -e 's/^.*=//' > /tmp/spam-ip.txt
>>
>> And then continue:
>>
>> cat /tmp/spam-ip.txt >> /usr/samba/mail/envelope
>> cat /tmp/spam-ip.txt | mail -s "SPAM IPs...." us.navy@outlook.com
>>
>> Finally, you can easily remove /tmp/spam-ip.txt.
> You could even take this one step further and eliminate the need for
> a temporary file altogether by making use of tee(1):
>
> awk '/spam=YES/ {print $11}' /var/log/maillog |
> sort |
> uniq |
> sed -e 's/^.*=//' |
> tee -a /usr/samba/mail/envelope |
> mail -s "SPAM IPs...." us.navy@outlook.com
>
> Patrick
> _
Patrik, you forgot to add the continuation \
at end of you lines. The Commander will not be able
to use this as it stands.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?557E1EA7.3080507>
