Re: [[email protected]: spt.sh script]

Cameron Simpson <[email protected]>
Newsgroups gmane.editors.sed.user
Message-ID <[email protected]>
On 23Feb2014 09:14, Ed Allen <[email protected]> wrote:
> ----- Forwarded message from Jude DaShiell <[email protected]> -----
> For any using spamassassin below is a script you can use to automate 
> blacklisting of the undesireables sending spam.  I'm sending this to the 
> list since it represents a use of sed and may be useful to others on this 
> list too.
> cut here.
> #!/usr/bin/env bash
> # file: spt.sh - handle today's blacklist entries.
> cd $HOME
> grep "^From:" $HOME/mail/probably-spam | cut -d \  -f 1-8 - >up3
> sed -i -e 's/^/blacklist-/' up3
> echo "adding `wc -l up3` new senders to blacklist"
> cat up2 up3 >up4
> sort up4 | uniq >up5
> cp up5 up4
> cat up1 up4 >up0
> cp up0 .spamassassin/user_prefs
> rm up3
> cp up4 up2
> rm up4
> 
> jude <[email protected]>
> 
> 
> ----- End forwarded message -----
> 
> What initially filled up2 ?
> 
> Without it 'cat up2 up3 >up4' becomes a rename.

Earlier runs of this script filled it.

There are many many things that should be changed in this script,
but that particular piece of logic is not one of them:-)
-- 
Cameron Simpson <[email protected]>

Who are all you people and why are you in my computer?  - Kibo
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.