# bash & spamdb: how to escape double quotes?



## cbrace (Dec 4, 2010)

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:


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

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


```
[...] xargs -I{} spamdb -T -a '{}'
```
or

```
[...] xargs -n1 spamdb -T -a
```

Escaping the double quotes doesn't work either:


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

Anyone know how to do this?

Thanks.


----------



## DutchDaemon (Dec 5, 2010)

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


```
echo  '\"._-cbvwaj\"@xxx.xx'
```


----------

