[Linux-disciples] xargs -0

Stephen R Laniel steve at laniels.org
Tue Jul 11 14:49:50 EDT 2006


On Tue, Jul 11, 2006 at 02:48:45PM -0400, Adam Rosi-Kessel wrote:
> Isn't what you want
> 
> grep -Zirl [pattern] [sourcePath] | xargs -i cp "{}" [destPath]
> 
> ??
> 
> (this won't necessarily deal with all escaping issues, but I think that's a
> different topic than your question)

No, I definitely know about the -i option, but the advantage
of -0 is that I don't need to worry about escaping (except
for the very unlikely case when there's a \0 in the
filename). It seems like I ought to be using xargs -0 all
the time, and I'd like to figure out how to do that.

-- 
Stephen R. Laniel
steve at laniels.org
Cell: +(617) 308-5571
http://laniels.org/
PGP key: http://laniels.org/slaniel.key
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://lists.bostoncoop.net/pipermail/linux-disciples/attachments/20060711/0fb82e95/attachment.pgp


More information about the Linux-disciples mailing list