bash & spamdb: how to escape double quotes?

Hi all,

I hope this is the right section for this query.

I have a cron job that adds to spamdb unknown addresses in my domain that receive spam. They become "spamtrap" entries, if you will, trapping the spambots.

It works fine, except that I regularly get spam sent to addresses containing double quotes, such as this "._-cbvwaj"@xxx.xx

Yes, the double quotes are included in the address.

I can add such an address manually to spamdb on the command line like this:

Code:
$ spamdb -T -a "._-cbvwaj"@xxx.xx

but I can't figure out a way of doing this in the Bash cron job, using xargs:

Code:
[...] xargs -I{} spamdb -T -a '{}'
or
Code:
[...] xargs -n1 spamdb -T -a

Escaping the double quotes doesn't work either:

Code:
 $ echo  \"._-cbvwaj\"@xxx.xx | xargs -n1 spamdb -T -a

Anyone know how to do this?

Thanks.
 
Single-quote the email address, and escape the double-quotes:

Code:
echo  '\"._-cbvwaj\"@xxx.xx'
 
Back
Top