On Wed, Jul 29, 2009 at 08:00:24AM -0300, Jose Fragoso wrote:
> Hi,
>
> I know this is not the right place to ask. Sorry in advance.
>
> I would like to delete some addresses from the spamd db
> using a pipe-like structure.
>
> Suppose that I want to remove all white IP addressses that
> start with 189.25. I could use
>
> spamdb | grep "^WHITE|189\.25\." | awk -F \| '{print $2}'
>
> Then I would run 'spamdb -d' for every address that is
> displayed, manually.
>
> Could I somehow pipe the output of above command directly
> to spamdb?
Add this to the end of your pipeline: | xargs -n1 spamdb -d
Note that spamdb will accept more than one address for -d, so you can
play with taking away the "-n1" or increasing 1 to a larger number to
make this more efficient.
--
Darrin Chandler | Phoenix BSD User Group | MetaBUG
[email protected] | http://phxbug.org/ | http://metabug.org/
http://www.stilyagin.com/ | Daemons in the Desert | Global BUG Federation