<p>I'm trying to copy a bunch of files below a directory and a number of the files have spaces and single-quotes in their names.  When I try to string together <code>find</code> and <code>grep</code> with <code>xargs</code>, I get the following error:</p>

<pre><code>find .|grep "FooBar"|xargs -I{} cp "{}" ~/foo/bar
xargs: unterminated quote
</code></pre>

<p>Any suggestions for a more robust usage of xargs?</p>

<p>This is on <a href="http://en.wikipedia.org/wiki/Mac_OS_X_Leopard" rel="noreferrer">Mac&nbsp;OS&nbsp;X 10.5.3</a> (Leopard) with BSD <code>xargs</code>.</p>

```
find . -print0 | grep --null 'FooBar' | xargs -0 ...
```
I don't know about whether
```
grep
```
supports
```
--null
```
, nor whether
```
xargs
```
supports
```
-0
```
, on Leopard, but on GNU it's all good.