2009/7/29 Jose Fragoso <[email protected]>:
> 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?
disclaimer: i never used spamdb.
if the output of spamdb | grep "^WHITE|189\.25\." | awk -F \| '{print
$2}' is like
189.25.6.3
189.25.45.45
and so on, and the right invocation of spamdb -d is
spamdb -d 189.25.6.3
spamdb -d 189.25.45.45
then you may try
for ip in `spamdb | grep "^WHITE|189\.25\." | awk -F \| '{print $2}'
`; do spamdb -d $ip; done
--
The best the little guy can do is what
the little guy does right