Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: recursive globbing, filename spaces and xargs



On Mon, Jan 17, 2005 at 05:15:49PM -0800, Philippe Troin wrote:
[...]
> > echo **/*  | xargs ls
> > 
> > but if there are spaces, it fails, and I can't seem to figure
> > out how to quote or escape the spaces.
> > 
> > Any suggestions, or should I stick to find?
> 
> print -N **/* | xargs -0 ....

That would still fail for filenames with backslashes or starting
with "-".

print -rN -- **/* | xargs -r0 ls -d --

Or
autoload -U zargs
zargs ./**/* -- ls -d

-- 
Stéphane



Messages sorted by: Reverse Date, Date, Thread, Author